Skip to content

Decide fresh-node unread behavior (history counts as unread on first connect) #7

Description

@dnorman

Summary

When a node connects fresh and syncs history from the server, the NotificationManager subscribes to each room's message query before that history has synced, so the synced messages arrive via changeset.added() (i.e. after the subscription started) and get counted as unread. A freshly-synced device therefore shows unread badges for pre-existing history on first connect.

Observed

Two simulators connected to the seeded server both showed badges on first connect — e.g. Scroll Test "10+" and General "1" — for messages that already existed on the server before the device connected.

Notes

  • This matches the reference (react/leptos) subscription mechanism — it's inherent to "count messages that appear after the subscription starts", not a regression in the RN port. (The added() vs initial-load distinction only skips history that is already local when the query subscribes.)
  • As UX it may be undesirable: a new device arguably shouldn't mark all existing history as unread.

Options

  1. Leave as-is (consistent with the other templates).
  2. Pre-mark history as read on initial sync per room (treat the first settled resultset as a read baseline).
  3. Only count messages whose timestamp is newer than when the manager started.

Acceptance

  • Decision recorded; if changing, apply consistently across the react / leptos / RN templates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions