Studio sync: handle 413 push failures gracefully - #3973
Merged
Conversation
- Stop retrying non-retryable 4xx (413, 403, …) in TUS upload retry logic; keep retrying 5xx, network errors, and transient 409/423. - Surface the real HTTP status from the TUS error instead of "Unknown error"; show a clear message for 413 (archive too large). - Note the 5 GB push pre-check matches the server ARCHIVE_UPLOAD_MAX_SIZE cap.
gavande1
marked this pull request as ready for review
June 26, 2026 13:20
Collaborator
📊 Performance Test ResultsComparing 79b6836 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
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.
Related issues
How AI was used in this PR
AI assistance was used to draft the retry-classification helper, the HTTP status extraction, and the user-facing error messages. I reviewed every change, restored the repository code formatting after an unintended reformat, and confirmed the new messages are translatable.
Proposed Changes
When a site push produces an archive larger than the WordPress.com upload (host site) limit, the server responds with 413. Before this change, the client kept retrying that response through every retry delay and then reported a vague "Unknown error" or a connection failure, so users could not tell what went wrong or how to fix it.
Now the upload stops on the first non-retryable client error (403, 413, and similar) and shows a clear, translatable message: a "site archive is too large" message for 413, or the HTTP status for other client errors. Transient failures (5xx, network drops, and the resumable 409 and 423 statuses) still retry as before, so normal pushes are unaffected.
Testing Instructions
Manual code review should be enough!
Pre-merge Checklist