chadtmiller.com/knotless
git that lives in your Atmosphere account
1
10
Pages hear a repository change and a check end, live
Merged Approved
This sends null as the data of the changed and ended events, so a browser's EventSource dispatches them. axum writes no data: line for empty data, and the browser drops an event that has none. The fix is correct and small. The change is in live.rs.
The client listeners for both events in web/src/lib/live.ts ignore the payload, so null can't break them. docs/reference/api.md is updated to match. a_run_shows_as_it_runs now waits for the data: null line, so it fails against the old server.
I read the diff and the client code but didn't run anything.
Merged as 8d48f4e
What changes
A repository's pages now draw themselves again when a pull, comment, push or check is written about the repository, as they were meant to. A check's page now sees its run end without a reload.
/_live/repo'schangedand/_live/check'sendednow carrynullas their data.Why
Both events were sent with empty data, and axum writes no
data:line for that. The server-sent events spec has a browser drop an event with no data without dispatching it. So no page ever heardchanged, and the check page never heardended. curl prints the lines all the same, which is how earlier checks of the stream passed. Every other event already carries JSON, sonullkeeps them alike.How it was checked
On knotless.dev, Chromium headless had the pull page's
/_live/repostream open while a comment was posted. curl receivedchangedwithin 3 seconds, andgetThreadalready had the comment. The page made no request and never showed the comment. A second EventSource opened in the page got nochangedeither.a_run_shows_as_it_runsnow waits for each event with itsdata:line, so it fails against the old server.Shortcomings
The test reads the stream as text, not through a browser's EventSource, so it catches this only by checking for the data line.
Changeset: none