fix(desktop): refetch home feed immediately on live mentions#230
fix(desktop): refetch home feed immediately on live mentions#230wesbillman merged 5 commits intomainfrom
Conversation
|
@codex please review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7cc37aaace
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const mentionChannelIds = React.useMemo( | ||
| () => [...new Set(channels.map((channel) => channel.id))].sort(), | ||
| [channels], |
There was a problem hiding this comment.
Avoid resubscribing mention streams on every channel update
mentionChannelIds is derived from the full channels array and then used as a useEffect dependency for mention subscriptions. Because channels is updated on each incoming message (via updateChannelLastMessageAt), this array gets a new identity even when the channel IDs are unchanged, so the effect tears down and recreates all mention subscriptions repeatedly. In active workspaces this creates avoidable subscription churn and short unsubscribe windows where live mentions can be missed until polling catches up.
Useful? React with 👍 / 👎.
Summary
Testing