Skip to content

Delivery events queued while an agent's process was down are not push-delivered on its return #28

Description

@Mearman

Delivery queues are per-store in-memory maps and serialise() excludes them, so a restarted bridge receives synced room and DM history (readable via read_room / DM reads — nothing is lost) but gets no push delivery (onDelivery) for what arrived while it was down.

Resolution is a design decision, either direction acceptable if recorded here:

Implement replay: include pending delivery events in the synced state and apply them as local delivery when the owning agent re-registers. Design considerations: replay must not re-notify for events already consumed (the mesh-store's localDeliveryKeys dedup is per-process and cleared on restart, while bridges like pi carry their own LRU dedup over recent delivery events, so bridge-level dedup catches most replays), auto-markRead fires on delivery (replays would re-mark-read messages whose receipts already propagated), and a long-down agent can accumulate a large replay set (bound it, or drain per subscription).

Or decide replay is wrong by design: history sync already covers correctness and push replay would be noise; in that case the boundary gets documented in the README's delivery section rather than left implicit.

Recorded during the #14 persistent-identity work; spun out as its own item because the design call is independent of identity stability.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions