Honor duplicate planning when manually adding orders - #480
Merged
Merged
Conversation
Constraint: Saved plans may share real orders; Dispatch and Start remain exclusive. Rejected: Remove execution guards with the planning guard | active routes must retain exclusive execution. Directive: Acquire sorted stop locks before order projection row locks in manual-add paths. Tested: Prisma generation, typecheck, 151 targeted tests including disposable database concurrency regressions. Scope-risk: moderate
This was referenced Oct 2, 2026
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.
Manual Add orders still rejected an order already planned in another group, despite the existing duplicate-planning contract. This allows that addition while retaining each group's child partition and leaving the source route and delivery facts unchanged.
Reserved or executing target routes recheck exclusive execution and claim the compatibility projection atomically. Manual additions acquire the same sorted stop locks before order row locks as Dispatch, avoiding a deadlock when they race.
Validation:
No schema migration or production data mutation. Release the API before the matching K-food Shopify candidate-filter correction.
Change control: EVNSolution/clever-change-control#309
Release verified: merged as 8974e31; exact-main CI 37042597925 and manual deploy 37043266209 succeeded. Production image revision and healthy API were verified. Matching Shopify PR320 is deployed; authenticated order #2324 is now selectable without submitting an addition.