fix: preserve route ETA when saving stop details - #479
Merged
Merged
Conversation
Skip unchanged operational overrides and refresh changed fixed-sequence geometry with tenant and input revision guards. Preserve historical planned ETA baselines on active routes and arrived or terminal stops. Constraint: Existing driver timestamps and route stop ordering remain authoritative. Rejected: Rebuild historical planned ETA from actual arrival events | Actual events cannot recover the deleted plan. Confidence: high Scope-risk: moderate Directive: Keep asynchronous geometry writes conditional on the exact inputs they used. Tested: Focused regressions 19/19; service and repository tests 130/130; independent five-file review.
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.
Saving unchanged stop details previously deleted route geometry and every planned ETA, leaving the depot End time blank. Compare the persisted override values first, preserve planned stop ETA baselines after departure, and refresh fixed-sequence geometry after a real routing input change.
The refresh commits only when tenant, route revision, route shape, and every stop revision still match. Incomplete provider results stay unavailable; a superseded calculation returns the current route. READY persistence excludes arrived and terminal stops. No optimizer run, route reordering, driver-event changes, or schema migration is introduced.
Validation: Prisma generation, full lint, typecheck, 3,027 tests, build, diff check, and independent five-file review passed locally. The 232 locally skipped cases include optional DB/environment suites; CI runs the disposable PostgreSQL checks. Focused service/repository regressions pass 130/130. The separate Shopify display fix is already deployed; this server change prevents recurrence of the cache/ETA loss.