Skip to content

fix: resend a leaf.page view report once when the container connection drops - #5862

Merged
max-sixty merged 1 commit into
mainfrom
fix/issue-5861
Nov 12, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/issue-5861

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

publish-site run 43160732700 failed because the hosted journey's browser-error gate caught one 500 from POST /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 forward resend a GET or HEAD once 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_view ignores a report whose sequence is not newer than the session's stored one, and still answers 204. So it's safe to resend. forward now 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 of retried now says so.

The new case in the Worker test checks that a disconnected POST api/user-view is sent again with the same body, answered with the second response, and logged with retried: true. It fails on main (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

…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
@max-sixty
max-sixty merged commit 3b9ff64 into main Nov 12, 2026
6 checks passed
@max-sixty
max-sixty deleted the fix/issue-5861 branch November 12, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants