Motivation
With more than one community in the rail, the desktop app only alerts for the active community. useLiveChannelUpdates subscribes to the active relay only, and useCommunityUnread polls inactive communities every 30s purely to light the rail dot / mention count — it never raises a notification. So if you are looking at community B, a DM or @mention in community A produces no banner and no sound; you only notice the rail dot later. Several people on our team hit this and assumed notifications were broken.
Proposed solution
Reuse the existing inactive-community observer path (withReadOnlyRelayClient, fetchObservedChannels) to also raise desktop notifications:
- Poll each inactive community (30s, same cadence as the rail) for new events in member channels since the last poll; first observation starts at "now" so there is no backlog burst.
- Classify with the same rules as the active community: DMs →
dm, direct @mentions → mention (pierce channel mutes), followed/participated thread replies → thread_reply, muted channels → silent.
- Cache the channel list / names / mutes per community (5 min) so the poll is one
REQ per community in steady state.
- Append the community name to the notification title (
… · <community>).
We have this running on a local build (~250 lines + tests, idle CPU ~0%). Happy to open a PR if this direction sounds right — or adapt it if you would rather keep persistent read-only subscriptions to inactive relays instead of polling.
Alternatives considered
- Persistent live subscriptions to every inactive relay: lower latency, but N extra sockets and more battery; polling reuses what the rail already does.
- Server-side push (as mobile does): out of scope for the desktop client.
Additional context
Related: #3235 (rail counts for @channel markers). None found for desktop alerts from inactive communities.
Motivation
With more than one community in the rail, the desktop app only alerts for the active community.
useLiveChannelUpdatessubscribes to the active relay only, anduseCommunityUnreadpolls inactive communities every 30s purely to light the rail dot / mention count — it never raises a notification. So if you are looking at community B, a DM or @mention in community A produces no banner and no sound; you only notice the rail dot later. Several people on our team hit this and assumed notifications were broken.Proposed solution
Reuse the existing inactive-community observer path (
withReadOnlyRelayClient,fetchObservedChannels) to also raise desktop notifications:dm, direct @mentions →mention(pierce channel mutes), followed/participated thread replies →thread_reply, muted channels → silent.REQper community in steady state.… · <community>).We have this running on a local build (~250 lines + tests, idle CPU ~0%). Happy to open a PR if this direction sounds right — or adapt it if you would rather keep persistent read-only subscriptions to inactive relays instead of polling.
Alternatives considered
Additional context
Related: #3235 (rail counts for @channel markers). None found for desktop alerts from inactive communities.