Missing optional chaining on actor_details and reaction_items in apps/space reactions and votes
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react, typescript
Research direction
Start with apps/space/components/issues/reactions/issue-vote-reactions.tsx and apps/space/store/issue-detail.store.ts, comparing the downvote and reaction handling with the guarded vote handling described in the issue. Check the related reaction and vote tests, if present, and run the relevant checks. Done means missing actor details or reaction items no longer cause a TypeError.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 61.9k
- Forks
- 6.3k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 75
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from makeplane/plane
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
makeplane/plane#10082 · 1 comment ·
Maintainers usually reply within 1 day
-
[bug]: Email notifications show a broken avatar for users without a profile photoPossibly taken @gurnoorpannu claimed this 21 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
makeplane/plane#10009 · 1 comment ·
Maintainers usually reply within 1 day
-
🐛 Bug: Calendar work items cannot be opened on mobilePossibly taken @pennnnnnnnnn claimed this 23 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
Similar issues
-
area: infrastructure bug priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
snapotter-hq/SnapOtter#4575 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
documentation server-memory v2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/servers#5457 ·
Maintainers usually reply within 1 day
-
comp: ssr comp: zones type: feature version: current (v17+)
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
angular/angularfire#3836 ·
Maintainers usually reply within 3 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day