Bug: Unused media visibility check and missing useMemo dependencies cause stale/invalid actions in MessageToolbox.js
Maintainer thường phản hồi trong vòng 1 ngà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ệ
- javascript, react
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu với packages/react/src/views/Message/MessageToolbox.js, tập trung vào kiểm tra khả năng hiển thị, mảng dependency của options useMemo và ánh xạ surfaceOptions. Xác nhận các thao tác chỉnh sửa và sao chép cần hoạt động như thế nào đối với tin nhắn âm thanh và video, cũng như trạng thái đang chỉnh sửa được biểu diễn ra sao. Công việc hoàn tất khi ba vấn đề được báo cáo đã được khắc phục và các thao tác trên hộp công cụ được cập nhật chính xác khi quyền được tải.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
In packages/react/src/views/Message/MessageToolbox.js, there are three bugs affecting message action visibility and state updates:
- Unused
isVisibleForMessageTypecheck & missing optional chaining:isVisibleForMessageTypeis computed on lines 93–95 to hide text-only actions (editandcopy) onaudio/mpegandvideo/mp4messages, but it is never applied tooptions.edit.visibleoroptions.copy.visible. Additionally,message.files?.[0].typelacks optional chaining on[0], which can throw aTypeErrorwhenmessage.filesis an empty array[]. - Stale
useMemodependencies for role permissions: TheoptionsuseMemohook omitsisAllowedToEditMessage,canDeleteMessage,isAllowedToReport,isVisibleForMessageType, andhandleCopyMessageLinkfrom its dependency array. When user roles and permissions load asynchronously, the memoizedoptionsobject fails to recompute, leavingEdit,Delete, andReportactions hidden or stale. - Dropped
colorandghostprops insurfaceOptions:options.editdefinescolorandghostproperties to highlight active editing state (isEditing), butsurfaceOptionsomits these properties when mapping items forSurfaceMenu.
Affected File
packages/react/src/views/Message/MessageToolbox.js(lines 93–218)
Expected Behavior
- Apply
isVisibleForMessageType(with safe optional chainingmessage.files?.[0]?.type) toeditandcopyvisibility. - Include all permission flags and handlers in the
optionsuseMemodependency array so toolbox actions update when roles resolve. - Forward
colorandghostproperties insurfaceOptions.
- Ngôn ngữ chính
- JavaScript
- Star
- 170
- Fork
- 397
- Merge trung bình
- 8 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của RocketChat/EmbeddedChat
-
bug(layout-editor): theme refinements like "change it to dark" are ignored with AI providersCó thể đã có người làm @arshil42 đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
RocketChat/EmbeddedChat#1433 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
RocketChat/EmbeddedChat#1432 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: emoji suggestions open for times like 12:00 and Enter inserts an emoji instead of sendingĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
RocketChat/EmbeddedChat#1431 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: editing a multi-line message saves literal \n instead of line breaksCó thể đã có người làm @arshil42 đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
RocketChat/EmbeddedChat#1430 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Nested inline code, emoji and mentions disappear inside bold, italic and strikethroughCó thể đã có người làm @gitseraj đã nhận 1 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
RocketChat/EmbeddedChat#1429 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của RocketChat/EmbeddedChat
Issue tương tự
-
accepted enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Edit: Telemante [YT]Đang mởchannels:edit check:passed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày