Mention of a user renders as a shorter mentioned name followed by leftover text
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
- 75/100
Hướng nghiên cứu
Bắt đầu bằng cách tìm MessageX.replaceMentions, được nêu trong issue, và theo dõi cách hàm này khớp từng người dùng trong mentionedUsers. Dùng đoạn mã Dart được cung cấp để tái hiện trường hợp với Ann và Anna, rồi kiểm tra văn bản nhắc tên được tạo ra và đích khi nhấn. Hoàn tất khi tên dài hơn hiển thị là @Anna và liên kết đến anna trong nội dung tin nhắn, bản xem trước và câu trả lời trích dẫn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Which packages are you using?
stream_chat_flutter
On what platforms did you experience the issue?
iOS, Android, Web, macOS, Windows, Linux (platform independent)
What version are you using?
10.6.0 (current master)
What happened?
When a message mentions two users and one user's name (or id) is a prefix of the other's, the longer mention renders as the shorter one followed by the leftover characters. Tapping it opens the wrong user.
For example, with Ann and Anna both mentioned in Hi @Ann and @Anna!, MessageX.replaceMentions returns:
Hi [@Ann](mention:ann) and [@Ann](mention:ann)a!
The message shows @Ann highlighted followed by a plain a, and the second mention points to ann instead of anna. The same happens with ids such as user1 and user12, and in the channel list preview and quoted replies (replaceMentions(linkify: false) turns @user12 into @First2).
replaceMentions replaces one mention source at a time with @<literal>, so whichever user comes first in mentionedUsers also matches the start of every longer literal that shares its prefix.
Steps to reproduce
final message = Message(
text: 'Hi @Ann and @Anna!',
mentionedUsers: [
User(id: 'ann', name: 'Ann'),
User(id: 'anna', name: 'Anna'),
],
);
print(message.replaceMentions().text);
// Hi [@Ann](mention:ann) and [@Ann](mention:ann)a!
In the app: in a channel with members Ann and Anna, mention Ann first, then Anna, and send the message.
Expected behavior
Hi [@Ann](mention:ann) and [@Anna](mention:anna)!
- Ngôn ngữ chính
- Dart
- Star
- 1.1k
- Fork
- 388
- Merge trung bình
- 3 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 74
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- 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 GetStream/stream-chat-flutter
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
GetStream/stream-chat-flutter#2497 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
GetStream/stream-chat-flutter#2885 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Expose showTitle and trailingBuilder of StreamVoiceRecordingAttachment for better customisabilityĐang mởenhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
GetStream/stream-chat-flutter#2341 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
GetStream/stream-chat-flutter#2288 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của GetStream/stream-chat-flutter
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
atsign-foundation/at_server#2896 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
lugassawan/swe-workbench#823 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
auto-implement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
bannzai/kashakeibo#142 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Images copied with `adb push` don't show in the wallpaper picker ("No images found on device")Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
meddouribadis/arclauncher#53 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
p: material_ui package team-design
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
flutter/flutter#195096 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày