Repository navigation
Keep remote persistent notifications in sync - #53
Merged
Merged
Conversation
…epochs The cloud relay sent `type: "notification"`, which the pinned control protocol's strict status schema rejects; its closed set spells the type `notifications`. Send the plural and check every emitted frame with the package's own `strictParseFrame`. The singular remains the local browser event name. Names, revisions, seq and the sent-set are scoped to one backend process, so after a restart the first frame could not retract earlier notices and a client fencing by seq would drop the new ones. Every frame's `show` is the complete list; mark it with `full: true` and a per-process `epoch` in the payload (the strict envelope strips unknown top-level fields). The client replaces its persistent notices on a `full` frame; local frames are unchanged. Detect changes by projected content instead of revision, so a producer re-raising the same condition no longer re-sends the list several times a second. The cloud path writes through the control channel's `sendFrame`.
Remote notification frames carry a per-process epoch, but the client never read it. A device restart starts its seq again at 1 while the browser can stay connected, so the existing fence dropped the restarted device's frames until the browser reconnected, and a late frame from the old process could re-show its notices. A full frame from a new epoch now resets the notification seq entry and becomes the current epoch. Frames from an epoch already replaced are ignored without moving the fence, and a partial frame from an unknown epoch is not merged. Local frames, which carry no epoch, are unchanged. Epochs are unordered random ids, so a frame from a process the client never saw cannot be recognised as old.
A list too large for one frame was held back entirely, including all-links-down, with nothing logged. The relay now keeps the most severe notices that fit, in their original order, adds a summary notice saying how many more are on the device, and logs the first cut once. A notice that keeps clearing and returning re-sent the full list on every 250 ms tick. Frames are now limited to one per second carrying the latest state. A notice the remote side has not had in the last ten seconds, or a severity rise, still goes out on the tick it appears. Cloud frames are checked with the pinned protocol's strictParseFrame before sending (about 10 us per frame). A rejected frame is not sent, is logged once and the latest state is retried. The check covers the envelope; the payload is an open record, bounded by the projection.
1 of 5 tasks
3 of 5 tasks
pjeweb
marked this pull request as ready for review
November 14, 2026 09:03
pjeweb
added a commit
that referenced
this pull request
Nov 16, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 17, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 17, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 18, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 18, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 19, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 21, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 22, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 23, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 24, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 24, 2026
Author
|
Still carried in the integration train and not upstream, so it continues as #247. |
pjeweb
added a commit
that referenced
this pull request
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Someone watching a box remotely, a moderator or a helper through the cloud or the legacy remote connection, can miss a warning from the box, keep seeing one that has already cleared, or get an outdated list after reconnecting. They then act on the wrong picture of what's going on with the stream.
What
How: the box checks its warning list every 250 ms and only sends when it changed. Every frame carries the complete list (
full: true) and anepoch, a random id for the running backend, so the CeraUI client replaces its whole list and can tell when the box has restarted. A shared filter swaps free-form warning text for fixed summaries before anything leaves the box. Cloud frames are checked against the control protocol before sending.Sits on #63 (the remote status allowlist), and needs #95 first for the build size limit.
Screenshots
Mock data; the same state at the PR base and head.
How to verify
Run
apps/backend/src/modules/remote/notification-relay.test.tsandnotification-catalog-sync.test.ts. They cover connect, change and clear, a warning toggling every 250 ms for ten seconds (at most one frame a second, settled state within a second), 401 warnings fitting into one frame with the summary, and a restarted box being heard by a browser that stayed connected.Testing and limits
fulland merges by id would keep them.Risks
Remote viewers now see fewer details than the local app, by design. Older remote clients that ignore
fullstill get correct additions.Checklist