android, desktop: text sent with forwarded messages can be empty
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
- 85/100
Hướng nghiên cứu
Bắt đầu trong ComposeView.kt quanh L842-L847, nơi các mục được chuyển tiếp được gửi sau lệnh gọi API chuyển tiếp, và đọc checkLinkPreview() tại L611-L612 để thấy rằng nó đọc composeState.value trực tiếp. Theo dõi cách cs được ghi lại trước lệnh gọi và so sánh với các nhánh gửi khác; văn bản được chuyển tiếp nên dùng trạng thái đã ghi lại đó. Hoàn tất nghĩa là việc gửi chuyển tiếp không còn phụ thuộc vào trạng thái compose có thể bị đặt lại bởi việc chuyển chat hoặc recomposition, với chú thích tại L845-L846 được xóa nếu nó không còn áp dụng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
Android and desktop. Messages are forwarded with text typed in the compose field. In rare cases the text message sent after the forwarded items is empty: the item shows no text and has no Copy option, while text was typed.
The text is sent as a reply to the last forwarded item, after the forward API call returns. The condition is checked on the compose state captured at send, but the sent content is read from the current compose state:
- ComposeView.kt#L842:
if (cs.message.text.isNotEmpty()) - ComposeView.kt#L847:
send(chat, checkLinkPreview(), ...), wherecheckLinkPreview()readscomposeState.value(L611-L612)
When the compose state is reset during the forward API call, MCText("") is sent. Copy is hidden for items with empty text (ChatItemView.kt#L425-L428).
Typing is blocked while inProgress is set (desktop, android), so the compose state is changed during the call only by these resets:
- Chat switch: the compose state is cleared and the draft of the opened chat is loaded (L1407-L1417, since #7308). The message is still sent to the chat where the forward was sent, so that chat receives either empty text or the draft of the opened chat. The draft also stays in the opened chat.
- ComposeView re-entering composition clears an in-progress state (L1628-L1632); ComposeView is composed only when no items are selected (ChatView.kt#L302).
- Sending disabled in the chat (L1440-L1444).
The window is longer when forwarding files or many items.
iOS checks and reads the current state (ComposeView.swift#L1525-L1526), so an empty message is not sent there.
Steps to reproduce (expected from code, not yet reproduced)
- Desktop: chat A, chat B with a saved draft.
- In chat A, forward several messages with files, type text, send.
- Before the forwarded items appear, open chat B.
Expected: chat A receives the forwarded items and the typed text.
Actual: chat A receives the forwarded items and an empty message, or the draft of chat B.
Proposed fix
Send the content of the compose state captured at send, as the other send branches do, and remove the comment at L845-L846 (typing is blocked while the message is in progress):
- // the current state, not cs: forwarding is never reached from the chat switch, and keeps what was typed
- // while it was in flight
- send(chat, checkLinkPreview(), quoted = message.id, live = false, ttl = ttl, mentions = cs.memberMentions, sign = sign)
+ send(chat, checkLinkPreview(cs), quoted = message.id, live = false, ttl = ttl, mentions = cs.memberMentions, sign = sign)
Alternative: check the current state, as iOS does. It drops the confirmed text without notice, so it is not proposed.
- Ngôn ngữ chính
- Haskell
- Star
- 19.7k
- Fork
- 1.3k
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 236
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọ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 simplex-chat/simplex-chat
-
enhancement triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 66/100
simplex-chat/simplex-chat#8043 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 77/100
simplex-chat/simplex-chat#7781 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
simplex-chat/simplex-chat#7714 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
simplex-chat/simplex-chat#7649 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
simplex-chat/simplex-chat#7585 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của simplex-chat/simplex-chat
Issue tương tự
-
[BUG]: C# programs with top-level statements fail to compileCó thể đã có người làm @AsyncNigam đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
compiler-explorer/compiler-explorer#9625 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs triage type: enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 3 ngày
-
reflex-0.10Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
commercialhaskell/stackage#8180 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OpenZeppelin/canton-contracts#140 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
takeInterval yields nothing, dropInterval drops nothingCó thể đã có người làm @GuillaumedeVolpiano đã 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 78/100
composewell/streamly#3271 ·