alibaba / alibaba/ChatUI

如果做打字机效果回复的 时候

Open
#130 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.4k
Forks
425
PR merge metrics
No merged PRs in 30d

Description

**Version information (版本信息)**
- ChatUI
- ChatUI :2.4.2
- React Version : 17.0.2
- OS Version macOS : 12.2.1
- Browser Version: 版本 120.0.6099.216(正式版本) (arm64)

**Describe the bug (描述问题)**
当使用打字机效果更新当前的一条消息的时候 消息的计数逻辑会一直增加+1导致显示的消息数对不上

**Steps To Reproduce (重现步骤)**
1. 新增一条消息 消息的内容最好是很长
2. 缩小当前的对话框 让滚动条出现 然后
3. 将滚动条拉到最顶触发出回到底部的提醒
4. 更新上一条新增的数据就会看到1条未读再更新就会出现2条未读

查看源码逻辑是这儿有问题
![image](https://github.com/alibaba/ChatUI/assets/25875642/67864722-b059-4eb7-8e17-7240dba6fa8e)

**Link to minimal reproduction (最小化重现链接)**
codesandbox 的链接地址 为 https://codesandbox.io/p/sandbox/chatui-demo-forked-fsy89q?file=%2Fsrc%2FApp.js%3A57%2C22
**Expected behavior (期望的结果是什么)**
期望可以正常更新 当前的消息数是按照消息的条数来更新的不是更新了原来的数据内容而导致计数 逻辑上不成立

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked CodeSandbox reproduction and the source logic shown in the issue screenshot. Reproduce the unread-count increase while a long message is updated with the typewriter effect, then trace the related message-count entry point. Done means updating an existing message does not increase the unread count, while adding a message still does.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.