fix: deduplicate preview deploys and normalize malformed WS envelopes#334
Closed
rarestg wants to merge 6 commits intocloudflare:mainfrom
Closed
fix: deduplicate preview deploys and normalize malformed WS envelopes#334rarestg wants to merge 6 commits intocloudflare:mainfrom
rarestg wants to merge 6 commits intocloudflare:mainfrom
Conversation
Applied consistent formatting across all files using prettier with: - singleQuote: true - printWidth: 120 - 2-space indentation (spaces, not tabs) Added .prettierignore, format/format:check scripts, and updated .editorconfig to match. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous formatting commit only applied quote and line-length changes but did not convert indentation from tabs to spaces per the .editorconfig and prettier config. This completes that work. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…velopes Gate preview deploy requests behind an in-flight guard so reconnects and state transitions do not trigger duplicate deploys. Normalize websocket messages where `type` contains stringified JSON before switch dispatch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
Opened against upstream by mistake. Recreating on fork. |
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.
Summary
sendWebSocketMessage(websocket, 'preview')behind an in-flight guard (previewDeployInFlight) so reconnects andcf_agent_statetransitions do not trigger duplicate preview deploy requests. The guard resets ondeployment_completedordeployment_failed.message.typecontains a stringified JSON payload (e.g.{ type: '{"state":...,"type":"cf_agent_state"}' }) before dispatching to the switch handler.Addresses P1 items from the sandbox RCA: preview deploy deduplication and websocket envelope normalization.
Test plan
previewWS message is sent (check network tab)cf_agent_stateupdate while preview is already deploying and verify no duplicate deploytypefield messages (stringified JSON) are correctly normalized and handled ascf_agent_stateGenerated with Claude Code