Skip to content

Fixes AB#3590267 Extend filter-then-clone optimization to deleteAccessTokensWithInters…#3114

Merged
siddhijain merged 5 commits into
devfrom
fix/filter-then-clone-deleteAccessTokensWithIntersectingScopes
May 15, 2026
Merged

Fixes AB#3590267 Extend filter-then-clone optimization to deleteAccessTokensWithInters…#3114
siddhijain merged 5 commits into
devfrom
fix/filter-then-clone-deleteAccessTokensWithIntersectingScopes

Conversation

@siddhijain
Copy link
Copy Markdown
Contributor

@siddhijain siddhijain commented May 14, 2026

Fixes AB#3590267
This PR extends use-filter-then-clone flight to one more method and add some telemetry attributes to check if the latency of ATS can be correlated to the number of accounts and credentials in memory.

Copilot AI review requested due to automatic review settings May 14, 2026 18:56
@siddhijain siddhijain requested review from a team as code owners May 14, 2026 18:56
@siddhijain
Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends the ENABLE_FILTER_THEN_CLONE_IN_MEMORY_CACHE flight to deleteAccessTokensWithIntersectingScopes in MsalOAuth2TokenCache, and adds two telemetry attributes capturing in-memory cache sizes to help correlate ATS latency with cache population. Also removes the now-unused in_memory_cache_used_for_accounts_and_credentials attribute and its emission site in BrokerOAuth2TokenCache.

Changes:

  • Add flight-gated filter-then-clone path to deleteAccessTokensWithIntersectingScopes, falling back to the legacy clone-all-then-filter path when the flight is off.
  • Introduce number_of_accounts_in_cache / number_of_credentials_in_cache telemetry attributes set in SharedPreferencesAccountCredentialCacheWithMemoryCache.getAccounts().
  • Remove the obsolete in_memory_cache_used_for_accounts_and_credentials attribute and its BrokerOAuth2TokenCache.getCacheToBeUsed emission; update changelog.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
common4j/src/main/com/microsoft/identity/common/java/cache/MsalOAuth2TokenCache.java Adds flight-gated filter-then-clone branch in deleteAccessTokensWithIntersectingScopes.
common4j/src/main/com/microsoft/identity/common/java/cache/SharedPreferencesAccountCredentialCacheWithMemoryCache.java Emits new account/credential count attributes in getAccounts().
common4j/src/main/com/microsoft/identity/common/java/cache/BrokerOAuth2TokenCache.java Removes emission of the deleted in_memory_cache_used_for_accounts_and_credentials attribute.
common4j/src/main/com/microsoft/identity/common/java/opentelemetry/AttributeName.java Adds two new attribute names; deletes the obsolete one.
changelog.txt Adds PATCH entry describing the optimization extension and telemetry.

…ersectingScopes

Resolved merge conflict in changelog.txt by keeping both entries in vNext section.

Co-authored-by: siddhijain <30181294+siddhijain@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 22b6858. The conflicts were in changelog.txt where both branches added entries to the vNext section. I merged both entries and verified the code integrity.

Copy link
Copy Markdown
Contributor

@mohitc1 mohitc1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Copy Markdown
Member

@rpdome rpdome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove mustMatchExactClaims if it's not used anywhere today, otherwise someone might make a regression in the future.

@siddhijain
Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

…ngScopes

Resolved merge conflict in changelog.txt by keeping both entries in vNext section.

Co-authored-by: siddhijain <30181294+siddhijain@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit f3703dd. The conflict was in changelog.txt where both branches added entries to the vNext section. I merged both entries and verified the code integrity.

@siddhijain siddhijain merged commit 3e6df21 into dev May 15, 2026
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants