Skip to content

fix(desktop): refetch home feed immediately on live mentions#230

Merged
wesbillman merged 5 commits intomainfrom
fix/notification-delays-live-home-feed
Apr 4, 2026
Merged

fix(desktop): refetch home feed immediately on live mentions#230
wesbillman merged 5 commits intomainfrom
fix/notification-delays-live-home-feed

Conversation

@wesbillman
Copy link
Copy Markdown
Collaborator

Summary

  • refetch the Home feed immediately when the existing live unread-message websocket stream receives an @mention for the current user
  • keep workflow approvals and other Home needs-action items on the existing poll path for now
  • add integration coverage that proves the Home badge and desktop notification update once without duplicate alerts after the follow-up Home refetch

Testing

  • cd desktop && pnpm typecheck
  • cd desktop && pnpm check
  • cd desktop && pnpm test:e2e:integration --grep "live mentions refetch the home feed without waiting for polling"
  • pre-push hook: cargo fmt --all -- --check
  • pre-push hook: cargo fmt --manifest-path desktop/src-tauri/Cargo.toml --all -- --check
  • pre-push hook: cd desktop && pnpm check
  • pre-push hook: cd desktop && pnpm build
  • pre-push hook: cargo check --manifest-path desktop/src-tauri/Cargo.toml
  • pre-push hook: cargo clippy --workspace --all-targets -- -D warnings
  • pre-push hook: ./scripts/run-tests.sh unit

@wesbillman
Copy link
Copy Markdown
Collaborator Author

@codex please review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +74 to +76
const mentionChannelIds = React.useMemo(
() => [...new Set(channels.map((channel) => channel.id))].sort(),
[channels],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@wesbillman wesbillman merged commit bf083dd into main Apr 4, 2026
8 checks passed
@wesbillman wesbillman deleted the fix/notification-delays-live-home-feed branch April 4, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant