Fix critical metadata retargeting and linear batch team-cache regression - #23
Draft
cursor[bot] wants to merge 2 commits into
Draft
Fix critical metadata retargeting and linear batch team-cache regression#23cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
Co-authored-by: Medhaug <Medhaug@users.noreply.github.com>
Co-authored-by: Medhaug <Medhaug@users.noreply.github.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.
Summary
This investigation found and fixed two high-severity correctness regressions in recent commits:
metadata.jsonproject_idand configureddolt_databasedisagreed but both appeared authoritative.Root causes
reconcileAuthoritativeServerMetadata, a singleproject_idmatch could overridedolt_databasewithout first rejecting contradictory authoritative signals from the currently configured database.linear.Tracker.BatchPush, state caches were built eagerly for all configured teams before processing, turning unrelated team failures into global batch failures.Fixes
project_idmaps to one database but configureddolt_databasehas a different authoritative project ID, reconciliation now returns an error instead of auto-retargeting.Validation
go test -tags gms_pure_go ./cmd/bd/doctor/fix -run 'TestReconcileAuthoritativeServerMetadata'go test -tags gms_pure_go ./internal/linear -run 'TestBatchPush_IgnoresUnusedBrokenTeamCache|TestBatchPush_PerTeamStateCache'make test; suite has unrelated environment/pre-existing failures outside touched codepaths (e.g., dolt binary/path and cmd/bd connectivity expectations), while touched packages pass.