Fail pull with a visible error when a backup is already in progress on the remote site - #4315
Draft
epeicher wants to merge 2 commits into
Draft
Conversation
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
The investigation and implementation were done with Claude Code: it traced a customer's
No backup ID foundlog line through the pull flow to the backup dedupe response, cross-checked the diagnosis against the site's backup history and the server-side findings, and wrote the fix plus tests. The code was reviewed by the PR author.Proposed Changes
When a pull is requested while the remote site already has a backup queued or running, the backup service dedupes the request. Studio treated that as a successful start, then silently stopped polling — the pull sat at "in progress" forever with no error, and the only trace was a
No backup ID foundlog line. Users hit this by restarting Studio mid-pull (losing the in-memory backup ID) and retrying while the original backup was still running server-side.With this change the pull fails fast instead of hanging: the user gets a dialog explaining that a backup is already in progress for the site and to retry in a few minutes, and the pull enters the normal failed state so it can be retried. Both server response shapes are handled — the current
200withbackup_id: 0and the upcoming409withcode: backup_already_in_progress— so behavior is identical across the server rollout. The 409 is an expected transient condition and is not reported to Sentry.As a defensive measure, the backup-status poller now also surfaces an error and marks the pull failed if it ever finds no backup ID, instead of silently abandoning the operation.
Testing Instructions
npm test -- apps/studio/src/stores/tests/sync-operations-slice.test.ts— covers the valid-ID happy path, both "backup already in progress" response shapes, and the poller guard.No backup ID found.Pre-merge Checklist