Repository navigation
Fixes GRE-799: stream authoritative job snapshots - #1255
Merged
Merged
Conversation
An admitted /ws/jobs/{id} socket sends the public read-one snapshot, then later commits. A terminal snapshot is followed by close 1000. Logout closes 1008 Session revoked and sends nothing further. A missing or foreign job upgrades and closes 1008 Job not found. HEAD stays 404 and does not subscribe.
A new upgrade with an already expired session stays HTTP 401. Close 1008 Session expired is for a socket that is already open.
A snapshot admitted before logout can still be written after logout returns. The next close is 1008, and no frame admitted after revocation is sent.
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.
An admitted job socket now sends the public snapshot, including the one queued at subscribe, and later commits on that job. A terminal snapshot is the last data frame, then the socket closes 1000. Logout closes 1008 Session revoked and sends nothing further. A missing or foreign job upgrades and closes 1008 Job not found without subscribing. HEAD for those callers stays 404.
Summary
GET /ws/jobs/{id}keeps the GRE-798 admission checks. Afterread_publicaccepts, the pump sends the same public JSON as read-one, withupdated_atremoved.done,error, andcancelledare followed by close 1000. Revocation and open-socket expiry close 1008. A lagged mailbox or a stopped jobs service closes 1011. A missing or foreign job never callssubscribe.The route still mounts only when
desktop_rebuildis compiled andPP_DESKTOP_REBUILDis exactly1ortrue.Definition of done
See the definition of done.
Evidence
Local checks used
CARGO_TARGET_DIR=/persist/targets/gre-799-job-wsandCARGO_BUILD_JOBS=2.Feature on:
cargo test -p pp-api --locked --manifest-path rust/Cargo.toml --features desktop_rebuild --test jobs_http -- --test-threads=216 passed.
Feature off:
cargo test -p pp-api --locked --manifest-path rust/Cargo.toml --test jobs_http job_ws_ -- --test-threads=24 passed. Each
job_ws_filter is the 404 stub.Clippy
-D warningsforpp-api--all-targetswas clean with--features desktop_rebuildand without it.The later commit only documents the logout admit window. It does not change the pump.
Declined nits
Sol approved the behavior. Council approved the same head. These stay out of this slice so the scored commit stays
040279eb.admitstays on the async worker. Moving it intospawn_blockingis a larger pump change, and this route is not mounted.preparewait sleeps on the job condvar. Nothing callswith_wait(Duration::ZERO). A longer poll would still hold one blocking thread per open socket. That cost belongs with the slice that mounts the route.close_missing, and missing HEAD stays 404. Open-socket expiry and owner-stop use the sameclose_reasonmatch. Updatingsessions.expires_atcannot fireStreamClose::Expired, because the stream keeps the expiry copied at subscribe.send_closedoes not wait for the peer close. The tests read the close frame from a client that does not answer it. A one second drain would stall every close in those tests. The web client closes itself when it sees a terminal snapshot.docs/gre-799-jobs-http.mdstays the revocation contract. The pump comment on this head states that a snapshot admitted before logout can still be written, and that nothing admitted after revocation is sent. Claude scored that gap a nit.docs/gre-798-jobs-http.mdstays the GRE-798 slice note. It already points snapshots and the 1008 close atdocs/gre-799-jobs-http.md.admitreturns, the second copy of the terminal status list, and theAdmissionwording stay as they are.Council review
Rounds: 1
Scored head:
040279ebc899c6fbee2bc702153f1b78c0445cd5.Exemption
Exemption: none
Reviewed with sol-loop: 1 round with Claude Opus 5.5 on xhigh. Sol verdict: approved.
Created with Grok 4.7 in T3 Code.