Skip to content

Studio sync: handle 413 push failures gracefully - #3973

Merged
gavande1 merged 16 commits into
trunkfrom
fix/stu-1843-push-413-error-handling
Jun 29, 2026
Merged

Studio sync: handle 413 push failures gracefully#3973
gavande1 merged 16 commits into
trunkfrom
fix/stu-1843-push-413-error-handling

Conversation

@gavande1

@gavande1 gavande1 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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

  • Have you checked for TypeScript, React or other console errors?
- 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 gavande1 changed the title Studio sync: handle 413 push failures gracefully (STU-1843) Jun 26, 2026
@gavande1
gavande1 marked this pull request as ready for review June 26, 2026 13:20
@gavande1
gavande1 requested a review from a team June 26, 2026 13:20

@epeicher epeicher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for handling this gracefully @gavande1! I have reviewed the changes and they LGTM!

@wpmobilebot

wpmobilebot commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 79b6836 vs trunk

app-size

Metric trunk 79b6836 Diff Change
App Size (Mac) 1315.58 MB 1315.56 MB 0.01 MB ⚪ 0.0%

site-editor

Metric trunk 79b6836 Diff Change
load 1062 ms 1067 ms +5 ms ⚪ 0.0%

site-startup

Metric trunk 79b6836 Diff Change
siteCreation 6483 ms 6475 ms 8 ms ⚪ 0.0%
siteStartup 6998 ms 7025 ms +27 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@gavande1
gavande1 merged commit d6249d0 into trunk Jun 29, 2026
11 checks passed
@gavande1
gavande1 deleted the fix/stu-1843-push-413-error-handling branch June 29, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants