Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes synchronize identity caches with singleton state and include regression coverage, with no blocking issues identified.
No open issues 🎉
What changed in this PR
Fixes #1495 by clearing cached identity IDs alongside singleton state, preventing subsequent requests from sending stale IDs in baggage headers.
Changes:
- Clear the corresponding cache in both identity-clear methods.
- Add regression tests checking singleton state, cached IDs, and generated baggage.
| File | Description |
|---|---|
| packages/core/src/sdk/UserInfoSingleton/UserInfoSingleton.ts | Clears the cached user ID. |
| packages/core/src/sdk/UserInfoSingleton/__tests__/UserInfoSingleton.test.ts | Tests user ID removal from cache and baggage. |
| packages/core/src/sdk/AccountInfoSingleton/AccountInfoSingleton.ts | Clears the cached account ID. |
| packages/core/src/sdk/AccountInfoSingleton/__tests__/AccountInfoSingleton.test.ts | Tests account ID removal from cache and baggage. |
Review effort: Balanced
This branch has not been deployed
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.
What does this PR do?
clearUserInfo()andclearAccountInfo()reset the stored info but leave the cached user and account ids inrum/helperin place. Those cached ids are whatRequestContextreads when it builds the baggage header, so once a user logs out, outgoing requests keep sending the previous user's id (and account id) until someone else logs in.This calls the existing
clearCachedUserId()/clearCachedAccountId()helpers from the two clear methods, so the cache follows the singleton.Motivation
Fixes #1495
Additional Notes
Added a test to each singleton's test file that sets the info, clears it, and checks that the cached id the baggage uses is gone afterwards.
This change was prepared with AI assistance and reviewed by the author.