Records Feature record

FDR-012

Notifications

Experimental Last reviewed 2026-11-23 Source file

Overview

Notifications and Unread dot indicators are user-scoped ways to show activity that deserves attention. Notifications form a persistent list of exact activity. Unread dot indicators add only neutral unread dots. Both forms cover direct messages, root messages in channel rooms, replies, direct and role mentions, @here, @all, followed threads, reactions, and room invitations. Notification occurrences use a small lifecycle: Unread, Read, or explicitly Deleted. Unread dot attention uses a latest-value marker that becomes inactive through read, visibility, and expiry boundaries.

The server records occurrences individually. The bundled frontend may consolidate them for presentation without changing occurrence identity, jump targets, unread counts, read state, or deletion semantics.

Behavior

  • Desktop users can enable native OS alerts with Push notifications on this device. Consent starts off and applies to all signed-in servers on that device. A local test checks OS delivery. The client builds alert text from the actor, activity, and room in the notification. Activity labels use the same translations as the notification list. A message preview appears only when its text is already available in a local room or thread timeline. The local OS receives this content and can show it on the lock screen, subject to OS notification settings. Alerts use existing live updates and notification polls; inactive servers do not gain persistent connections or additional polls. Alert formatting does not request content or create timeline stores. An unloaded message still produces an immediate activity summary. Desktop does not change notification API responses or Web Push formatting. New Important occurrences that need attention can alert after the initial notification list loads. Older pages, repeated reads, Ambient occurrences, and occurrences observed during Do Not Disturb do not alert. Each eligible batch uses the selected server-specific sound once. Reading or removing an occurrence clears its retained alert after the client observes the change. Session and access boundaries clear retained alerts and click targets. An occurrence missing from a partial page remains unknown. Its alert and click target stay available until handling or expiry is confirmed, or until the device's limit of 64 retained alerts removes the oldest alert. Retained targets contain no actor or room display text or message previews.

  • On macOS, closing the desktop window keeps Chatto running. The Dock reopens the window. Command-Q quits the app and stops new alerts. On Windows and Linux, closing the main window quits the app. Chatto adds no menu bar or system tray icon. OS shutdown and update restarts can still terminate the app. This delivery contacts only the user's Chatto servers and the local OS; it does not use an external push provider.

  • Option/Alt+Shift+Down opens the next unread notification source across signed-in servers. The quick switcher offers the same action. Important notifications come before Ambient notifications, followed by rooms with plain Unread dots. Sources follow server order, room-group order, and stable room/thread IDs for remaining ties. The newest unread occurrence at that priority opens in the selected conversation. Existing view and read rules apply, so each use selects from the sources that still need attention. There is no Previous action. The shortcut works in the composer and leaves drafts intact, but does not run while a modal is open. Selection uses only data already held by the frontend and does not fetch notification pages. Unread dots open the room without a message jump. When no source remains, it shows “No unread notifications”.

  • The notification page combines activity from all signed-in servers. The header bell opens it inside the current server's layout and keeps its room sidebar available. A back link returns to that server's remembered room. The global notification URL remains available without a selected server.

  • The list sorts by newest activity. All shows both Unread and Read activity; Unread shows only groups with unread occurrences. A separate type filter selects Reactions, Replies (including followed threads), or Mentions (direct, role, @here, and @all). Filters combine, and pagination continues past pages without matches. Dismiss read still applies across all servers and types. Dismiss controls use the standard neutral icon treatment. The filters start with All notifications and All types to distinguish their purposes without visible group labels. URL parameters status and type retain the filters through navigation, browser Back, and reload. Missing or unknown values select All. All notification rows use neutral backgrounds. Unread rows show their summary in bold. Read rows use muted text in regular weight and remain fully interactive. The list does not use a separate unread dot on each row.

  • Unread dot activity does not add a row to the notification page. It adds a neutral unread dot to the applicable room. A thread-scoped Unread dot contributes to its parent room. An orange notification indicator takes priority when both types of attention apply.

  • A room or direct-message row shows two unread notification counts next to each other: an orange count of Important notifications and a neutral count of all other notifications. Each count opens the newest unread notification that it counts. The bell, server, and application indicators show one combined indicator.

  • The application icon shows an unnumbered badge when unread Important notifications need attention on any signed-in server. The window title shows their total count. Ambient notifications do not contribute to either indicator. Reading the last Important notification clears both indicators, even if Ambient notifications remain unread.

  • Page titles use Page · Server, with the current route's server name once. App-wide pages and app preferences use Page · Chatto, including preferences opened from server settings. Public authentication pages use the origin server name. The Important count is a prefix, for example (3) #general · Chatto HQ.

  • The list groups activity by calendar day using the preferred time zone of the account on each server. Today's rows show elapsed time; older rows show the local clock time. Each section has a visible heading: Today, Yesterday, or the date for older days.

  • Rows use short localized summaries without message previews. Reaction rows show the emoji that were given. The time is at the end of the summary line. Wide rows show the summary, room, server, and time on one line. Narrow rows hide the room name. Summaries truncate with an ellipsis. Room names remain visible at intermediate widths and truncate before they are hidden. The server name stays visible when the list combines servers. On hover-capable devices, dismiss controls replace the timestamp on hover or keyboard focus without reserving a column. Touch devices keep a visible dismiss control. A badge on the actor avatar shows the cause: the first reaction emoji, or an icon for direct messages, mentions, replies, and room messages.

  • When more than one server is signed in, a small server logo before the actor avatar and the server name after the room name identify the server of each row. The hover text of the logo adds the host.

  • The list has no panel frame. Below 768px viewport width, summaries and metadata wrap so the activity remains readable. This layout applies to both touch and mouse input.

  • Opening a message activity row navigates to the selected occurrence's exact room, thread, and event. The occurrence is marked Read only after the target is visible and highlighted. An interrupted load keeps the selected target until navigation completes or the user leaves the destination or selects another target. A failed jump does not itself mark the occurrence Read.

  • Invitation notifications use Push by default and support the same delivery preferences. They open the room without a message target and become Read after successful navigation. Reading or deleting them does not resolve the invitation. Acceptance, decline, or expiry removes them from history. Invitation Unread dot attention lasts while the invitation is pending.

  • Reading a room or thread marks covered occurrences Read. A reaction is covered according to the reacted-to message and reaction horizon.

  • While the viewer is present at the latest message of an open thread, the bundled client marks each unread reaction occurrence on its root and replies Read, including reactions that arrive after the last message read. A thread root belongs to its room, so a thread read alone does not cover reactions to the root. Other unread activity in the room stays unread. A failed read stays unread until the viewer opens the thread again, returns to it, or scrolls back to the latest message.

  • The bundled client reads a room or thread only up to the newest message that the viewer can see. While the timeline shows the latest message, the read covers the full conversation. After a jump to an older message, newer messages and their notifications stay unread until the viewer scrolls to them. The client sends such a read when scrolling stops, and only when the viewer sees a message that no earlier read covered.

  • While a thread is visible in a focused app, its loaded unread notifications do not add local badges or play sound. This rule applies before the server confirms the read. It does not change notification history or remote push delivery. If a read fails, remaining unread activity can show again when the user leaves the thread. Other threads keep their attention indicators.

  • Notifications cannot be marked Unread. There is no Done state or Inbox/Done split.

  • The Delete action deletes the exact visible occurrences in the current row. On devices that support hover, this action appears when the row has hover or keyboard focus. It remains visible on touch devices.

  • Dismiss read loads all remaining pages across signed-in servers, then deletes the Read occurrences. It does not delete Unread occurrences that arrived before or during the action. If a page fails to load, the action reports an error and does not start deletion. Both deletion actions update the UI optimistically and then reconcile with the server.

  • Message-derived occurrences leave application-visible state 90 days after their source activity. Reading or deleting them does not extend that lifetime. Physical cleanup may continue during ADR-076's 24-hour grace period without extending user-visible retention.

  • A message Unread dot source gives attention for 90 days after its source activity. A read, visibility loss, target removal, reaction removal, or a change of the notification policy or thread follow can end the attention sooner.

  • The combined multi-server list preserves healthy results when another server fails and exposes the failure as partial.

  • Notification delivery rules and client sound choices are User Preferences. The server saves delivery rules. The client saves sound and sound-filter choices for each server. Notifications from different registered servers can use different sounds.

  • A root message in a direct-message room uses the Direct message cause. A message inside a direct-message thread uses Followed thread activity for its followers. It does not also create a Direct message occurrence.

Design Decisions

1. Exact occurrences, client-side grouping

Decision: The server exposes one occurrence for each recipient, source activity, and notification cause. List and notification totals count exact unread occurrences, independently of pagination and presentation grouping. The bundled frontend groups DMs by conversation, root room messages by room, reactions by reacted-to target, and followed activity by thread. It leaves mentions and replies separate because they have distinct jump targets.

Why: Exact server resources preserve identity, triage, navigation, and integration semantics. Client-side grouping can evolve without a migration or loss of information. Two unread DMs may appear as one row while still contributing two to the badge.

Tradeoff: Clients must maintain presentation groups and their exact member IDs. A group opens its newest unread occurrence, or its newest occurrence when all members are Read.

2. Persistent read state with explicit deletion

Decision: Reading is monotonic: an occurrence may move from Unread to Read but not back to Unread. Read occurrences remain in the list until the user deletes them or the 90-day retention window expires. Deletion is idempotent and privacy-oriented rather than a synonym for reading.

Why: Read state answers whether attention is outstanding; deletion answers whether the item should remain in personal history. Combining them would make it impossible to dismiss without handling or to retain handled activity.

Tradeoff: The server must preserve bounded triage and deletion history so a replay cannot recreate a deleted item.

3. Delivery policy is separate from attention level

Decision: Each configurable notification signal class resolves independently. A room uses its override, its current room-group override, and the user's server preference in that order. A direct-message room skips the room-group level. If the user has no server preference, the concrete product default supplies the server value.

  • Off — do not create attention for this cause.
  • Unread dot — add only a neutral unread dot. Do not create a notification occurrence, play a sound, or send push.
  • In-app notification — create an in-app notification without push delivery. The client can play the configured notification sound for Important attention.
  • Push notification — create the same in-app notification and make it eligible for Web Push or native delivery.
Cause Default
Direct calls Push notification
Room calls Off
Root direct message Push notification
Root message in a channel room Unread dot
Direct username mention Push notification
Reply to the user's message Push notification
Role mention Push notification
@here Push notification
@all Push notification
Followed thread activity In-app notification
Reaction to the user's message In-app notification

Both call rows support Off, In-app notification, and Push notification. Direct calls use the server setting and an optional override for the individual DM. Room calls also support a room-group override. These settings apply when a member starts a call. The Direct messages row still controls root messages in a DM. The alert offers Open room and Dismiss. Open room takes the member to the conversation, where they can see the current call and choose whether to join.

During a rolling upgrade, an older replica cannot read an incoming-call signal. If the member's stored occurrences include that signal, a notification-list request to that replica returns UNIMPLEMENTED for the whole list, even when the call would fall outside the requested page. An upgraded replica can return the list. Dismiss marks the occurrence as read. Joining the call or ending it removes the occurrence. To restore list access for all members on every replica, finish the server rollout.

Attention level controls presentation separately: reactions are Ambient and all other current causes are Important. Bell, server, and app indicators use notification orange when at least one contributing unread occurrence is Important and a neutral treatment when every contributing occurrence is Ambient. Room rows show the Important and the Ambient counts separately. Ambient notifications do not play a local sound. Attention levels are not user-configurable in this iteration.

Why: Whether activity is stored, whether it leaves the app, and how strongly it is presented are different choices. The delivery names state where the notification goes. Sound remains a client preference for both notification modes when the notification has Important attention.

Tradeoff: More than one policy dimension exists conceptually, although the current product exposes only delivery-mode preferences.

The notification settings page shows the supported causes as matrix rows. It shows the server, visible room groups, joined or invited channel rooms, and current-member direct-message rooms as columns. Each group column is followed by its room columns. A server cell always shows a concrete value. When no user preference exists, it shows the product default at full intensity without an inheritance marker. Server cells cycle through Off, Unread dot, In-app notification, and Push notification.

Room-group and room cells cycle through Inherit, Off, Unread dot, In-app notification, Push notification, and back to Inherit. Direct calls and Room calls skip Unread dot at every scope. Off uses a neutral crossed-out bell, and Unread dot uses a neutral small filled dot. In-app notification uses an orange bell, and Push notification uses an orange phone. These icons show delivery mode; their colour does not show the activity's attention level. An inherited cell shows the effective mode at reduced intensity. The legend and distinct icons make the state clear without colour alone.

Unread dot decisions use the existing room and thread read boundaries. A thread Unread dot rolls up to its parent room. Reading the thread clears its contribution to the room indicator. The Message Read Cursor remains separate and places the New messages separator. Cursor lag alone does not create a room dot. Thus, setting Room messages to Off prevents neutral dots for ordinary root messages without disabling last-read tracking. Unread dot does not update an operating-system or application-icon badge.

Posting a message does not advance the poster's Message Read Cursor or notification read boundary. The bundled client uses the same read path for arrivals from the viewer and other authors when the viewer is present at the latest message. Arrivals while the viewer is away or reading older history do not mark the conversation read. The viewer's own arrivals do not place a New messages separator. A thread reply does not mark the parent room read. This keeps sending independent of which messages the viewer has seen.

The scope filter always keeps the server column. A room match also keeps its parent group. A group match keeps all current-member rooms in that group. Direct-message policy applies at server scope and to individual direct-message rooms. Its room-group and channel-room cells are not applicable and cannot be changed. Room-message policy applies at server, room-group, and channel-room scope. Its direct-message-room cells are not applicable and cannot be changed.

A room uses the group that contains it when the durable notification materializer processes the source activity. Deleting a group leaves its saved user preferences inert. Group IDs are not reused, and deletion does not fan out cleanup writes to user configuration aggregates.

Room-group and room policy writes validate scope access at request time and use OCC on the user's configuration aggregate. A concurrent membership loss, room deletion, or group deletion can leave a newly committed preference inert, but it cannot change another user's state or grant access to the deleted scope.

4. Materialization uses current policy and visibility

Decision: Notification recipients and effective policy are derived asynchronously from committed domain facts and the current projected state when the durable materializer processes them. Membership, preference, room-group, authorization, and thread-follow changes that are already visible can affect the decision. One exception applies: a thread follow makes a reply followed thread activity only when the follow began before the reply. A follow that starts after the reply, such as the automatic follow of a mentioned user or of the root author, does not add an occurrence for that reply. The first reply of a thread reaches the root author unless the root author unfollowed the thread. A later reply in the projection does not change this. Thus the decisions for a reply do not depend on how far the projection advanced before the materializer processed the reply. A user's own activity does not notify them. One source activity produces at most one notification per recipient within the short duplicate window. The broker guard uses the exact source event ID and recipient ID. Different messages in the same thread remain separate. When several causes match in one batch, Push notification takes priority over Notification. Equal modes keep the first cause in the stable decision order. The selected occurrence keeps its cause and ID. The guard does not read or delete it. The window is tunable. This is a mitigation for duplicate fanout, not a change to how each cause is detected. Old replicas bypass this guard until the upgrade is complete. Badge decisions still use the applicable room or thread. Channel-room recipients must currently have message.read. A direct mention also permits its recipient when message.read-interactions applies, because the same message fact creates the interaction relationship.

Why: Notifications are eventual attention, not permanent domain facts. Current state avoids sending work that is already stale and avoids retaining historical authorization and policy views. The durable source consumer does not acknowledge until its bounded notification output is stored, so recovery does not require notification-only events in permanent domain history.

Tradeoff: Delivery is eventually consistent with the source activity, and changes before materialization can change or suppress its attention. The implementation must preserve a recoverable handoff between the domain log and the bounded notification lifecycle. ADR-076 defines that architecture.

5. Current visibility remains a privacy boundary

Decision: An occurrence may be listed, opened, mutated, or delivered only while the recipient still exists and can currently see its room and exact target. An invitation requires a current, eligible pending invitation for the recipient; it does not require room membership or message access. Message-derived occurrences also require current message.read, or message.read-interactions with a relationship to the target's thread. Without applicable access, Chatto hides the occurrence. Removed reactions, retracted targets, deleted rooms, and lost room access remove the corresponding occurrence. Durable visibility-loss boundaries prevent old queued activity from reappearing after a quick regain of room access. Actor identity is hydrated from current account data; an unavailable or deleted actor does not by itself expose copied profile data or make an otherwise valid occurrence invisible. Unread dot attention is computed from the current room, target, reaction, and read state, the current membership start, and the current notification policy (ADR-109). It does not use visibility-loss boundaries: an unread message counts again when the user can read it again.

Why: Source-time eligibility explains why the notification was created, but it cannot override present-day privacy and target existence.

Tradeoff: An occurrence can disappear without direct user triage, and reads must coordinate with current authorization state before reporting absence or success.

6. Realtime delivery is a convergence hint

Decision: Realtime notification updates tell clients to replace their finite notification view from authoritative server state. Unread dot updates tell clients to replace only unread and Slow Mode activity for the affected room. This update does not repeat room membership or permission decisions. A new source sends an update only when it turns Unread dot attention on. Another source in a scope that is already unread sends no update, because the public unread value stays true. My Threads can decorate a followed thread from matching unread occurrences in the finite notification view. The thread read cursor remains the only source of reply-unread state. Unread totals remain exact even when rows are grouped. The client also performs quiet periodic reconciliation so a lost transient update cannot leave counts stale indefinitely. The fallback runs once per minute. It reads only when the most recent successful notification read is older than a limit that depends on the realtime state:

  • When the live socket is caught up with current authority, the limit is five minutes. Each live hint and each caught_up reads the list. Thus, the fallback reads only when realtime read nothing for five minutes.
  • In all other states, the limit is five seconds. These states include connecting, disconnected, and dormant. A dormant server gets no hints, and a slow inactive poll of another server can delay its poll.

The server can fail to deliver a hint while the socket stays open, for example when a publish fails or a replica loses its NATS connection. Then the fallback starts a read at most six minutes after the lost hint. Before, this time was one minute. This bound applies only while the browser runs the timer on schedule. A suspended or frozen page runs no timer, and the list changes only when a read succeeds. A hint, a reconnect, or another read can repair the list sooner. Concurrent fallback requests share one read. Failed reads and privacy resets do not delay recovery. @chatto/client owns this rule in ServerStateStore.reconcileNotifications. The host owns the timer. This coordination adds no persistent connections.

Why: A transient notification invalidation is not durable notification state. Rebuilding the finite projection avoids exposing internal storage coordinates or asking clients to replay lifecycle facts.

Tradeoff: A change can cause a bounded list refresh rather than a tiny row-level patch.

7. Notification signals are extensible, not domain authority

Decision: Each occurrence contains a typed signal with its exact destination and cause-specific data. New signal variants must define authorization, lifecycle, navigation, and delivery behavior. A notification may call attention to a future resource such as a room invitation, but the notification itself does not grant access or become authoritative invitation state.

Why: Rich variants can carry future cause-specific data without growing a flat reason/target matrix, while keeping security-sensitive domain decisions in their owning feature.

Tradeoff: Older clients render an unknown signal generically and cannot navigate it. Older servers reject operations on variants they cannot safely validate rather than guessing.

8. Thread subscriptions are distinct from notification rows

Decision: Posting in a thread attempts to follow it, even after an earlier unfollow. A delivered direct username mention in a channel-room root or reply attempts to follow that thread unless the recipient previously opted out. The root message ID identifies the thread for a root mention. Role, @here, and @all mentions do not follow threads. Following a thread creates an activity source whose delivery is still controlled by notification policy. Follow controls belong to threads, not to notification rows. Root channel-room activity uses the Room messages cause. A room-specific Room messages policy supplies the required opt-in control without a separate room-follow state. Root direct-message activity uses the Direct messages cause. Thread activity uses Followed threads in both channel rooms and direct-message rooms, so one thread message does not also create a broad Direct messages occurrence.

Why: A subscription describes future interest in a conversation; a notification occurrence describes one past activity. Keeping them separate avoids giving list triage surprising subscription side effects.

Tradeoff: Automatic thread follow is best-effort after the source message commits. Failure can omit later followed-thread notifications until the user follows the thread explicitly.

9. Client-rendered sounds remain server-specific

Decision: The client stores notification sound and sound-filter choices for each registered server. For a live notification, the client uses the choices for the server that produced the notification. The server reports creations, not sound instructions, including during Do Not Disturb. The client checks its shared account Do Not Disturb choice, current unread state, and attention level before playback. Only new unread Important notifications can cause a sound. Ambient notifications stay silent so low-attention activity does not interrupt the user. The client groups eligible creations received during one refresh into one sound. Duplicate hints, failed reads, and missing rows do not cause another sound. Browser reconciliation stays silent. With desktop alerts enabled, a new eligible occurrence found by polling can produce one sound for the batch. Both delivery paths use the same attention, Do Not Disturb, and sound preferences. During an upgrade, the client copies the old global sound choice when it first creates the slot for a server.

Why: The client plays the sound, but all notification behavior is a User Preference. Storage for each server keeps this scope. It does not incorrectly record a client audio filter as server state. The migration keeps the user's existing sound choice.

Tradeoff: Sound choices do not sync to another browser or device. The client keeps a small local-storage entry for each server. Both In-app notification and Push notification can cause the configured local sound for Important attention. The client can miss a sound if its bounded resource page does not contain the created occurrence. These hints are not durable delivery. Web Push retains server-side policy and Do Not Disturb checks.

10. Notification occurrences are one bot event family

Decision: A bot receives notification changes through the same semantic public event stream as a human account. Direct messages, direct mentions, replies, and followed-thread activity can create notification occurrences, but they do not define the complete bot event set. A bot can also receive every other authorized semantic public event, such as message edits, reactions, room changes, and membership changes. Chatto does not create a separate interaction-only realtime subscription.

Why: Notification policy describes attention state, not all domain activity that can interest an integration. One public event stream gives bots complete authorized activity without making the frontend notification model the bot API.

Tradeoff: An integration must filter the shared event stream for the event types that it uses. An active realtime connection can still miss intermediate changes outside the bounded resume window. A future webhook adapter needs its own delivery, retry, and acknowledgement rules.

11. The client reads up to the visible message

Decision: The bundled client reads a room or thread through the newest message in the viewport, not through the latest message. Room and direct-message rows show separate Important and Ambient counts, and each count opens its own newest notification.

Why: A room read marks every covered notification Read. If opening one notification reads the full room, the other count also disappears, although the viewer did not see its activity. With separate counts, the viewer can still see the remaining count until they scroll to its message.

Tradeoff: A read is a position, not a set of seen messages. A read through a message also covers older notifications above it that the viewer did not see. A viewer who leaves a room within a second of scrolling can leave newer activity unread.

Compatibility

Notifications 2.0 supersedes Notifications 1.0 at the 0.5.0 pre-1.0 boundary. Legacy records and coarse Muted/Normal/All Messages preferences are not migrated or interpreted. Historical persisted event variants remain replay-decodable, but current code adds no notification occurrences, triggers, or Unread dot markers to EVT. Notification policy changes remain user-configuration facts in EVT. Older clients cannot use the replacement notification API on an upgraded server. After the 0.5.0 contract ships, new signal variants are additive.

The policy API uses only NotificationPolicyService, with explicit server, room-group, and room scopes. Chatto 0.5 removes the redundant policy methods from NotificationService so each operation has one public service. Stored policy state is unchanged by this removal. Deprecated delivery names and followed-room slots remain readable so old stored values do not acquire a new meaning. Current clients use Room messages at room scope instead of the retired followed-room cause.

Older servers do not derive Unread dot or Room messages output and cannot apply room-group policy. During rollback, those additions become temporarily inactive instead of turning into another notification cause. Older clients can render an unknown occurrence generically, but cannot infer its navigation target. Deployments must replace all replicas before depending on the new policy and occurrence behavior. Exact protobuf compatibility details belong in the public schema and API compatibility guide.

Permissions

Notification policy and triage are user-scoped. Current account, room, applicable message-read authority, message/thread target, and exact reaction visibility govern whether an occurrence may be listed, opened, mutated, or delivered. There is no separate permission to manage another user's notification list.

Records that name this record

Esc