Repository navigation
fix(api): match history rows to scoped accounts by provider and external id - #593
Merged
Merged
Conversation
…nal id The History scope filter keyed account names by external id alone, so two accounts on different providers sharing an external id made the visible rows depend on list order. Resolve the name from CloudAccountID when set, else from provider plus external id, and skip names that are ambiguous. Closes #550
Contributor
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 35 minutes for your next included review. View limit detailsLimit details: You’ve used the included review currently available. Your 64 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (2)
Comment |
In-flight history rows store the account UUID in AccountID with no CloudAccountID, so provider plus external id lookup hid them from name-scoped users. Try the UUID first. Add tests for UUID rows and for same-provider external id ambiguity.
This was referenced Oct 6, 2026
8 tasks
This was referenced Oct 25, 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.
Closes #550
History scope filtering keyed account names by external id alone. With the same external id on two providers, a name-scoped user saw or lost rows depending on account list order. The name now comes from CloudAccountID when set, otherwise from provider plus external id (reusing accountNameByExternalID). A legacy row without a provider matches only when one account across providers has that external id. Ambiguous ids resolve to no name.
Tests: handler_history_scope_provider_test.go drives GET /api/history through HandleRequest in both account list orders; 5 of 6 subtests in SameExternalIDAcrossProviders failed on main and pass now.
Not changed: other resolveAccountNamesByID callers. Rows with the account UUID in AccountID and no CloudAccountID are matched by UUID first.