Repository navigation
fix: resend a leaf.page view report once when the container connection drops - #5862
Merged
Merged
Conversation
…n drops The Worker resent a GET or HEAD once after the Containers SDK's connection-loss 500 (#5815), but no POST. A tab's view report (`POST api/user-view`) is a POST that Python answers the same way when it arrives twice, because a report replaces only an older report from its session. So its loss reached the browser as a console 500, and the deployed journey's browser-error gate failed publish-site on that one dropped observation. `forward` now resends a view report once too, from a copy of the request taken before the first attempt. No other write is resent. Refs #5861
This was referenced Nov 12, 2026
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.
publish-siterun 43160732700 failed because the hosted journey's browser-error gate caught one 500 fromPOST /examples/triage-board/api/user-view. Cloudflare logged that 500 at 05:32:55 UTC as{component: "leaf-container", event: "http_error", method: "POST", source: "disconnected", retried: false}, which is the Containers SDK's connection-loss response. The container stayed up through it: the same hosted turn kept logging steps and finished normally about 7 s later.#5815 made
forwardresend aGETorHEADonce after a dropped connection, but no write, since a write may already have reached Python. A view report is a write Python answers the same way when it arrives twice.observe_user_viewignores a report whose sequence is not newer than the session's stored one, and still answers 204. So it's safe to resend.forwardnow resends a view report once too, from a copy of the request it takes before the first attempt. Every other write still passes its loss to the caller, and the README's description ofretriednow says so.The new case in the Worker test checks that a disconnected
POST api/user-viewis sent again with the same body, answered with the second response, and logged withretried: true. It fails onmain(500 instead of 204) and passes here.pnpm run check:worker(type check and the Worker suite) passes.This change doesn't explain why the container connection drops while the container is still running. #4656 tracks that cause. It applies to the writes this change leaves alone, such as
api/event.Refs #5861 — automated triage