Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#10,111 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react, typescript
Lĩnh vực
backend, frontend

Hướng nghiên cứu

Bắt đầu với apps/space/components/issues/reactions/issue-vote-reactions.tsx và apps/space/store/issue-detail.store.ts, so sánh cách xử lý lượt downvote và reaction với cách xử lý vote có kiểm tra điều kiện được mô tả trong issue. Kiểm tra các bài test liên quan đến reaction và vote nếu có, rồi chạy các bước kiểm tra phù hợp. Công việc hoàn tất khi thiếu thông tin actor hoặc thiếu mục reaction không còn gây ra TypeError.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
61.5k
Fork
6.2k
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
77

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của makeplane/plane

Tất cả issue của makeplane/plane

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.