block / block/buzz

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

Open
#6,276 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

**Describe the bug**

Pulse `@mentions` do not produce a native desktop notification or a Buzz Home/Mention badge while the Buzz window is open but unfocused.

The relay accepts and indexes the kind:1 event with the recipient's `p` tag correctly. The desktop client also has Desktop alerts, Home badge, and the `mention` alert category enabled. However, the Home feed is not refreshed while the app is unfocused, so the notification pipeline never sees the mention.

This appears to be a notification reliability regression from #5490. That PR intentionally changed `useHomeFeedQuery()` from a normal 30-second interval to `useFocusedRefetchInterval(...)`, pausing network refetches on blur. Pulse mentions are feed-driven rather than delivered through the real-time channel notification path, so they are now silenced whenever the user works in another app.

**Steps to reproduce**

1. In Buzz Desktop, enable:
- Desktop alerts
- Home badge
- Mention alerts
2. Keep Buzz running and connected, then focus another macOS app. Do not quit Buzz.
3. From another Buzz identity, publish a Pulse note (kind:1) with a valid `p` tag for the signed-in user.
4. Wait longer than the Home feed's 30-second polling interval.
5. Observe that:
- no macOS notification appears;
- no Buzz Home/Mention badge appears;
- the mention event is not added to the client's `buzz-home-feed-seen` state while Buzz remains unfocused.

**Expected behavior**

A valid Pulse mention should notify the user while Buzz is running but unfocused, just like other notification-bearing events. At minimum, the Home/Mention badge should update; when desktop alerts are enabled, a native macOS notification should also appear.

The fix should preserve #5490's CPU improvements. Options include keeping only the notification-bearing mentions query active while unfocused, or delivering kind:1 `p`-tag mentions through a real-time WebSocket notification path instead of relying on foreground-only Home feed polling.

**Version and platform**

- Buzz version: 0.5.17
- OS: macOS 26.5.1 (25F80), Apple Silicon

**Logs / additional context**

Controlled live reproduction:

- Buzz Desktop process remained running.
- Relay returned HTTP 200 and stored the kind:1 event.
- Server-side `event_mentions` indexed exactly the intended recipient `p` tag.
- Client settings confirmed `desktopEnabled: true`, `homeBadgeEnabled: true`, and `slotAlertsEnabled.mention: true`.
- After more than 30 seconds with Buzz unfocused, the event ID was still absent from the client's `buzz-home-feed-seen` local state.
- Test events were deleted after verification.

Relevant code/history:

- #5490 changed `desktop/src/features/home/hooks.ts` to use `useFocusedRefetchInterval(connected ? 30_000 : false)` and explicitly documents that network query polling pauses on blur.
- `desktop/src/features/notifications/use-feed-desktop-notifications.ts` emits mention notifications only when the Home feed query returns a new eligible item.
- The reminder-notification reliability concern was explicitly handled during #5490 review, but feed-based Pulse mentions were not covered by an equivalent exception or regression test.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.