Repository navigation
Refuse a sync request while that project is already syncing - #2960
Merged
Merged
Conversation
A sync request that arrived while the project's sync was already running got a 200, as if a sync covering the caller's changes had been queued. But the running sync may have read the repo before those changes were pushed, so the caller could wrongly conclude its changes were synced. QueueJob now returns a QueueJobResult and tracks whether a queued sync has started. A request that finds the sync still waiting in the queue is covered by it and still gets a 200; one that finds it already running gets 429, and a full queue gets 503 instead of a false 200. Split out of #2439. Co-authored-by: Robin Munn <rmunn@pobox.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 46 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
hahn-kev
approved these changes
Nov 9, 2026
myieye
added a commit
that referenced
this pull request
Nov 11, 2026
…sts (#2966) Since #2960, re-triggering a sync that's already running returns 429, so both DuringSyncInProgress tests in DeleteProjectTests failed on their second trigger. A 429 there is the state the tests want, so the re-trigger now accepts it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
AI summary
Summary
Second of three PRs split out of #2439. Before this change, asking FwHeadless to sync a project whose sync was already running got a 200, as though a sync covering the caller's changes had been queued. But the running sync may have read the repo before those changes were pushed. Now that request is refused with 429, so the caller retries once the running sync finishes.
SyncHostedServicenow marks a queued sync as started when the worker takes it, which is howQueueJobtells "queued" from "running". The dictionary entry is still claimed with a single atomicGetOrAdd, so this needs no lock.What users see (LexBox already passes FwHeadless 4xx responses through unchanged, since #2884):
docs/site/technical/sync/fwheadless-merge.mdis updated; it said re-triggering a running project was a no-op.Evidence
SyncHostedServiceQueueTests(new):Merge Danger
Door: two-way
Blast Radius: small
Clicking sync while that project's sync is running now shows "already running, try again" instead of quietly waiting on the running sync. FW Lite's automatic sync doesn't call this endpoint; only the manual FieldWorks Classic sync and the Lexbox button do.
Test plan
dotnet test backend/Testing --filter "FullyQualifiedName~SyncHostedServiceQueueTests|FullyQualifiedName~ProjectDeletionServiceTests": 10 passed🤖 Generated with Claude Code