Skip to content
quarry Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0ebe5cc133753b2b76c4c9997cf5fe8ee1dbc43796344185f2e214dbbdc13c06
Ticket: 38d6b16e880f095e38ca7260fdb3d39db8c5a48c
Landing page is no longer live at load: stream invalidation, not rendered rows
User & Date: dmestas on 2026-08-18 23:34:26
Changes

  1. Untracked field cmimetype: "text/x-markdown"
  2. comment changed to:
    The fleet listing used to open its SSE stream at page load and repaint as stores ingested. It no longer does: the stream is opened by the filter input on first keystroke (check-in dcbfa94c). Live filtering works; live-at-load was traded away to get it, and that trade should not stand.
    
    ## Why it had to go
    
    A stream carries the filter it was opened with. Opened at load that filter is empty, so a few seconds after a reader types into the box the background stream repaints the listing UNFILTERED — the rows they asked for replaced by the rows they did not.
    
    Cancelling the stale stream does not fix it. Datastar RETRIES a connection it aborted (retry "auto", retryMaxCount 10), so the unfiltered stream reconnects on its own and clobbers the view again. Observed directly: correct 4 rows immediately after typing, back to 23 about five seconds later.
    
    requestCancellation is per element and keyed by plugin name, so two attributes on one element DO cancel each other — the retry is what defeats it, not the cancellation.
    
    ## The actual fix
    
    Stop streaming rendered rows. The stream should carry an INVALIDATION signal — "the fleet changed, revision N" — and the client should re-request the listing using its current form state:
    
    - Server: /fleet.sse emits datastar-patch-signals with a monotonically increasing revision whenever any store ingests. It renders nothing and therefore carries no filter, so it cannot be stale by construction.
    - Client: a debounced signal-patch handler on the filter input re-issues the listing request with the form content type. Any change — a keystroke or a server revision bump — takes the same path and always sends the current filter.
    - /fleet.frag is a one-shot: one datastar-patch-elements for #fleet, then close. No long-lived connection holding stale parameters.
    
    That also removes the last long-lived stream from the landing page, which matters for the scale ticket (fbe8dbfcc2): one open SSE connection per idle viewer is a per-reader cost, and a revision signal is cheap enough to broadcast.
    
    ## Acceptance
    
    - Load the page, do not touch it, cause an ingest: the listing updates.
    - Filter to a subset, wait past any poll interval: it stays filtered.
    - Filter, then cause an ingest: the listing updates AND stays filtered.
    - Scripting off: the form still submits and the server renders the same page.
    
    ## Related
    
    The timeline page still opens its stream at load and is unaffected — it has no filter to go stale against. Whatever shape this takes should be applied there too, so both live surfaces work the same way rather than by two different mechanisms.
    
  3. severity changed to: "Important"
  4. status changed to: "Open"
  5. title changed to:
    Landing page is no longer live at load: stream invalidation, not rendered rows
    
  6. type changed to: "Code_Defect"