Visitar URL original
Missing optional chaining on actor_details and reaction_items in apps/space reactions and votes · Issue #10111 · makeplane/plane · GitHub
Skip to content

Missing optional chaining on actor_details and reaction_items in apps/space reactions and votes #10111

Open

Description

@shafiktanbir

In apps/space/components/issues/reactions/issue-vote-reactions.tsx, the upvote tooltip on line 80 safely uses optional chaining when reading actor_details (allUpVotes.map((r) => r.actor_details?.display_name)), as do lines 51, 52, and 58 (vote.actor_details?.id). However, the downvote tooltip on line 125 accesses r.actor_details.display_name directly without optional chaining:

allDownVotes
  .map((r) => r.actor_details.display_name)
  .slice(0, VOTES_LIMIT)

Similarly, in apps/space/store/issue-detail.store.ts, addIssueVote (line 413) and removeIssueVote (line 428) guard against nullish vote_items and actor_details ((this.details[issueID].vote_items ?? []).filter((v) => v.actor_details?.id !== this.rootStore.user.data?.id)), whereas addIssueReaction (line 324: ...this.details[issueID].reaction_items) and removeIssueReaction (line 346: this.details[issueID].reaction_items.filter((_r) => !(_r.reaction === reactionHex && _r.actor_details.id === this.rootStore.user.data?.id))) right above them do not guard against nullish reaction_items or _r.actor_details.

Adding optional chaining on r.actor_details?.display_name in issue-vote-reactions.tsx and guarding reaction_items ?? [] / _r.actor_details?.id in issue-detail.store.ts prevents a TypeError when actor_details or reaction_items is absent. I can put up a small PR if that's helpful.

Activity

  1. Krishgupta102 commented on Oct 27, 2026

    @Krishgupta102

    Hi! I'd like to contribute a fix for this issue.

    I'll investigate the null-safety problems in the reaction and vote components, verify the affected code paths, and add regression tests where appropriate.

    I noticed the issue is open, but the description mentions that the reporter may submit a PR. Is this still available for another contributor to work on?

    Thanks!

  2. ghazy2001 commented on Oct 29, 2026

    @ghazy2001
    Contributor

    Hi @shafiktanbir! 👋

    I've opened PR #10148 to address this:

    • Updated the downvote tooltip in \�pps/space/components/issues/reactions/issue-vote-reactions.tsx\ to use optional chaining (
      .actor_details?.display_name), aligning it with the upvote tooltip and emoji reactions.
    • Added null-safety guards in \�pps/space/store/issue-detail.store.ts\ across \�ddIssueReaction,
      emoveIssueReaction, \�ddCommentReaction, and
      emoveCommentReaction\ to safely handle nullish
      eaction_items, \comment_reactions, and \�ctor_details?.id.

    PR: #10148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions