This differential prevents DM activity handler from spamming unread status unpdates by sending updates only for threads that are unread when we enter them and using debouncing when receiving messages to currently active thread.
Details
Details
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Branch
- marcin/eng-9267
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
lib/handlers/dm-activity-handler.js | ||
---|---|---|
89 ↗ | (On Diff #44314) | If there is pending debounced call from previous active thread we want to call it right now. |
110 ↗ | (On Diff #44314) | Checking for change in latest message makes sense only if we are in the same thread. |
web/redux/redux-setup.js | ||
460 ↗ | (On Diff #44314) | This code was changing thick thread read status before dm activity handler could detect change and send necessary updates. |
Comment Actions
This solution feels a lot more complicated than it should. Maybe it has to be that complicated, with canceling and flushing, but I'm not sure.
Would it be possible to have a memo, with activeThread as a dependency, where we store the denounced function and then simply call this function in an effect, without canceling and flushing?