Bakes the "pending" badge on the entities queued IN THIS SESSION.
🛑 THE ORDER IS WHY THIS IS NOT ONE LINE IN THE WRITE PATH. Measured in a browser: the core
announces that the queue moved (geoleaf:offline:outbox-queued) BEFORE the capture is on
its layer — the editor writes the layer once the write is safe. Marking at the announcement
finds nothing to mark. So a queued entity is remembered, and marked at the first
geoleaf:layer:updated of its layer that finds it there. An entity already on its layer —
a served one, modified — is marked at once.
⚠️ The mark is itself a write of the layer, hence announced: the entity leaves the waiting
list BEFORE it is marked, so its own announcement finds nothing left to do.
A deletion is owed too, but leaves the map: nothing to mark. An annulled pair (a creation
deleted before it was sent) stops waiting.
Returns ()=>void
A cleanup function that removes the listeners and forgets what was waiting.
Example
constdetach = registerSessionBadge(); // … at teardown detach();
Bakes the "pending" badge on the entities queued IN THIS SESSION.
🛑 THE ORDER IS WHY THIS IS NOT ONE LINE IN THE WRITE PATH. Measured in a browser: the core announces that the queue moved (
geoleaf:offline:outbox-queued) BEFORE the capture is on its layer — the editor writes the layer once the write is safe. Marking at the announcement finds nothing to mark. So a queued entity is remembered, and marked at the firstgeoleaf:layer:updatedof its layer that finds it there. An entity already on its layer — a served one, modified — is marked at once.⚠️ The mark is itself a write of the layer, hence announced: the entity leaves the waiting list BEFORE it is marked, so its own announcement finds nothing left to do.
A deletion is owed too, but leaves the map: nothing to mark. An annulled pair (a creation deleted before it was sent) stops waiting.