Fixes AB#3590267 Extend filter-then-clone optimization to deleteAccessTokensWithInters…#3114
Conversation
…ectingScopes and add telemetry attributes
|
@copilot resolve the merge conflicts in this pull request |
There was a problem hiding this comment.
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_cachetelemetry attributes set inSharedPreferencesAccountCredentialCacheWithMemoryCache.getAccounts(). - Remove the obsolete
in_memory_cache_used_for_accounts_and_credentialsattribute and itsBrokerOAuth2TokenCache.getCacheToBeUsedemission; 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>
…ntersectingScopes
rpdome
left a comment
There was a problem hiding this comment.
Let's remove mustMatchExactClaims if it's not used anywhere today, otherwise someone might make a regression in the future.
|
@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>
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.