Repository navigation
app/: live updates over SSE (sc-8900, ported sc-8897) - #94
Draft
ndbroadbent wants to merge 1 commit into
Draft
ndbroadbent wants to merge 1 commit into
ndbroadbent wants to merge 1 commit into
Conversation
… and a build page each follow a server-sent event stream (GET …/projects/{project}/live and …/builds/{number}/live) and read their data again when it says changed; the streams carry no data of their own, are open to the project's members (anyone for a public project, a 404 otherwise, as the pages), gather a burst of notifications into one event, say changed after a reconnection or when they fell behind, and end after 30 minutes so the browser reconnects and access is checked again; BuildChanged, a new build and a build starting to process notify build:<id> and project:<id>; the frontend's useLive hook invalidates the page's queries and the pages poll only while no stream is open (today's server has none); design doc
ndbroadbent
marked this pull request as draft
December 3, 2026 00:00
This branch has not been deployed
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.
Ports live updates to app/.
GET /api/ui/orgs/{org}/projects/{project}/liveand.../builds/{number}/live: server-sent events on Postgres LISTEN/NOTIFY (live::subscribe). Achangedevent goes out at most every 300 ms. A lagged receiver or the*topic sends one too, so a page that missed notifications reads everything again. Streams end after 30 minutes or at shutdown, and send a keep-alive every 15 seconds.tell_open_pagesonBuildChanged, plus build creation and processing inhttp/api/builds.rs.useLiveinvalidates the page's queries onchangedand when the stream reopens. Polling runs only while no stream is open.app/tests/live_pages.rs(5 tests) andsrc/__tests__/live.test.tsx(3 tests).docs/design.mddescribes it under Stack and hosting.Stacked on #77 (laravel-forge-sync). It will be retargeted to main when #77 merges.