Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

Fixes AB#3444129

Cherry-picks two commits from dev to enable in-memory caching for accounts and credentials in the broker.

Commits

Changes

Core Implementation (BrokerOAuth2TokenCache.java)

  • Added static ConcurrentHashMap to share in-memory cache instances across BrokerOAuth2TokenCache instances
  • Reduces disk I/O and serialization overhead by reusing cache layers for the same underlying storage

Feature Flag (CommonFlight.java)

  • Added USE_IN_MEMORY_CACHE_FOR_ACCOUNTS_AND_CREDENTIALS (default: false)

Telemetry (AttributeName.java)

  • Added in_memory_cache_used_for_accounts_and_credentials attribute

Tests

  • New BrokerOAuth2TokenCacheWithInMemoryCacheTest.java (1240 lines)
  • Extended BrokerOAuth2TokenCacheTest.java with cache sharing tests

Conflicts Resolved

changelog.txt had conflicts due to version markers in the release branch. Resolved by adding entries under vNext:

- [MINOR] Share SharedPreferencesInMemoryCache across instances of BrokerOAuth2TokenCache (#2813)
- [MINOR] Use SharedPreferencesInMemoryCache implementation in Broker (#2802)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Xmx3072m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)
  • www.puppycrawl.com
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.23.3/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.23.3/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.23.3/x64/codeql/xml/tools/xml-extractor.jar --fileList=/home/REDACTED/work/microsoft-authentication-library-common-for-android/.codeql-scratch/dbs/java/working/files-to-index2294403091429273239.list --sourceArchiveDir=/home/REDACTED/work/microsoft-authentication-library-common-for-android/.codeql-scratch/dbs/java/src --outputDir=/home/REDACTED/work/microsoft-authentication-library-common-for-android/.codeql-scratch/dbs/java/trap/java (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Cherry-pick the following commits from the dev branch to the working/release/23.1.1 branch:

Include all files and changes from the specified commits. Ensure that any conflicts are noted in the pull request description. Provide a detailed summary of what was cherry-picked in the PR body.

This pull request was created as a result of the following prompt from Copilot chat.

Cherry-pick the following commits from the dev branch to the working/release/23.1.1 branch:

Include all files and changes from the specified commits. Ensure that any conflicts are noted in the pull request description. Provide a detailed summary of what was cherry-picked in the PR body.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@github-actions
Copy link

✅ Work item link check complete. Description contains link AB#3417272 to an Azure Boards work item.

Copilot AI and others added 2 commits November 25, 2025 21:12
Updated version number and removed duplicate entry.
Copilot AI changed the title [WIP] Cherry-pick commits for release 23.1.1 Cherry-pick in-memory cache implementation for release 23.1.1 Nov 25, 2025
Copilot AI requested a review from siddhijain November 25, 2025 21:14
@siddhijain siddhijain marked this pull request as ready for review November 25, 2025 21:14
@siddhijain siddhijain requested review from a team as code owners November 25, 2025 21:14
@github-actions
Copy link

❌ Invalid work item number: AB#3417272,. Work item number must be a valid integer.

Click here to learn more.

@siddhijain siddhijain changed the title Cherry-pick in-memory cache implementation for release 23.1.1 Cherry-pick in-memory cache implementation for release 23.1.1 FixesAB#3444129 Nov 25, 2025
@github-actions
Copy link

❌ Invalid work item number: AB#3444129

Cherry-picks. Work item number must be a valid integer.

Click here to learn more.

@github-actions
Copy link

❌ Invalid work item number: AB#3444129

Cherry-picks. Work item number must be a valid integer.

Click here to learn more.

Copy link
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:

@github-actions
Copy link

✅ Work item link check complete. Description contains link AB#3444129 to an Azure Boards work item.

@siddhijain siddhijain changed the title Cherry-pick in-memory cache implementation for release 23.1.1 FixesAB#3444129 Cherry-pick in-memory cache implementation for release 23.1.1 Fixes AB#3444129 Nov 25, 2025
@siddhijain siddhijain merged commit dd12700 into working/release/23.1.1 Nov 25, 2025
31 of 43 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.

4 participants