Skip to content

fix(desktop): deliver Pulse mentions live so they notify while unfocused - #7130

Open
mdschoff wants to merge 1 commit into
block:mainfrom
mdschoff:fix/desktop-live-pulse-mention-refresh
Open

mdschoff wants to merge 1 commit into
block:mainfrom
mdschoff:fix/desktop-live-pulse-mention-refresh

Conversation

@mdschoff

Copy link
Copy Markdown

Problem

Fixes #6276: Pulse @mentions produce no native desktop notification and no Home/Mention badge while the Buzz window is open but unfocused.

Mention alerts are feed-driven: use-feed-desktop-notifications.ts only sees a mention when the home feed query returns it. #5490 (intentionally, for CPU/power) switched the home feed to useFocusedRefetchInterval(...), pausing polling on blur — so feed-driven mentions are silenced exactly when the user is working in another app. The #5490 review carved out an exception for reminders and approvals (useLiveHomeFeedActions: an always-on live #p WebSocket subscription that triggers an imperative feed refetch), but Pulse mentions (kind 1) were not included.

How it was implemented

  • Add KIND_TEXT_NOTE to the existing always-on live #p subscription in desktop/src/app/useLiveHomeFeedActions.ts. A Pulse note p-tagging the user now arrives over the WebSocket (which stays connected regardless of focus) and triggers the same homeFeedQuery.refetch() the reminder/approval exception already uses; the refetched feed flows into the existing badge and desktop-notification pipeline.
  • This preserves fix(desktop): quiesce renderer polling while hidden (#3677) #5490's power win: no background polling is resumed. Network work happens only when an event actually p-tags the user.
  • The subscription filter is extracted into an exported buildHomeFeedLivePTagFilter() with regression tests documenting the constraint, so the Pulse kind can't be silently dropped later.

How to test manually

  1. In Buzz Desktop enable Desktop alerts, Home badge, and Mention alerts.
  2. Keep Buzz running and connected; focus another app (do not quit or minimize-quit Buzz).
  3. From another identity, publish a Pulse note (kind 1) with a p tag for the signed-in user.
  4. Before: nothing happens until refocus (and the 5-minute focus stale-time can delay it further). After: the native notification fires and the Home/Mention badge updates within a moment of the event arriving.

No UI changes — behavior-only, so no screenshots.

Verification

  • desktop: pnpm test — 5,802 pass (3 new)
  • desktop: pnpm typecheck, biome check, pnpm build — clean

Related

Searched open PRs — none found addressing this. #5490 is the (intentional) origin of the regression; this follows the exception pattern its review established for reminders. Sibling PR #7123 fixes the separate active-channel suppression bug in the same notification area.

The home feed poll pauses while the window is unfocused (block#5490), and
Pulse @mentions (kind 1) are feed-driven: with the poll paused, the
notification pipeline never saw them, so no native notification and no
Home/Mention badge appeared until the user refocused the app.

Approval requests and reminders already had an exception: an always-on
live #p subscription that triggers a home-feed refetch when a matching
event arrives over the WebSocket. Add kind 1 to that subscription so a
Pulse mention refreshes the feed — and flows into the existing badge and
desktop-notification pipeline — the moment it arrives, without resuming
any background polling. The filter is extracted into
buildHomeFeedLivePTagFilter() with regression tests.

Fixes block#6276

Signed-off-by: mdschoff <mdschoff@gmail.com>
@mdschoff
mdschoff requested a review from a team as a code owner August 31, 2026 17:50
@github-actions

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is bc006f67087b049e2f9c4d8a2f26faceff628225...3013f43a5eac145524f99e7db6d7fecfff3fe091.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 3013f43a5eac145524f99e7db6d7fecfff3fe091 to authorize a new review.
Any previous review applies only to its recorded range.

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.

Desktop: Pulse @mentions do not notify or badge while app is unfocused

1 participant