Skip to content

Conversation

Copy link
Contributor

Copilot AI commented May 28, 2025

Overview

This PR enhances how configuration data is cached in the Android Client SDK to standardize behavior across all DevCycle client SDKs. The improvements focus on three key areas:

  1. Standardizing TTL - Default cache duration increased from 7 days to 30 days
  2. User-specific Caching - Configs now stored by user ID instead of just anonymous vs. identified
  3. Cleanup of Expired Configs - Added automatic cleanup of old cached configurations
  4. Migration of keys - from old format to new format
  5. Adding tests - for DVCSharedPrefs

Fixes #225.

Warning

Firewall rules blocked me from connecting to one or more addresses

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 --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=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 -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/gradle-launcher-8.5.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/agents/gradle-instrumentation-agent-8.5.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.5 (dns block)

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


💡 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.

Copilot AI changed the title [WIP] Update Cached Config Logic Update Cached Config Logic to Support User-specific Caching and 30-day TTL May 28, 2025
Copilot AI requested a review from jonathannorris May 28, 2025 17:54
Copilot finished work on behalf of jonathannorris May 28, 2025 17:54
@jonathannorris jonathannorris changed the title Update Cached Config Logic to Support User-specific Caching and 30-day TTL feat: Update Cached Config Logic to Support User-specific Caching and 30-day TTL Jun 2, 2025
@jonathannorris jonathannorris marked this pull request as ready for review June 2, 2025 21:22
Comment on lines 75 to 78
editor.remove(legacyKey)
editor.remove(legacyUserIdKey)
editor.remove(legacyFetchDateKey)
migrationOccurred = true
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't you remove regardless if a subset of the data exists?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! I've updated the migration logic to clean up legacy keys regardless of whether we can migrate them completely. Now we check for each legacy key individually and remove it if it exists, preventing orphaned keys from staying in SharedPreferences. Added test coverage for this scenario as well. See commit e0a2b6c.

Copy link
Contributor Author

Copilot AI commented Jun 3, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses

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 --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=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 -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/gradle-launcher-8.5.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/agents/gradle-instrumentation-agent-8.5.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.5 (dns block)

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

Copilot finished work on behalf of JamieSinn June 3, 2025 13:57
@jonathannorris jonathannorris requested a review from jsalaber June 3, 2025 18:38
@jonathannorris jonathannorris merged commit d2608a4 into main Jun 4, 2025
6 checks passed
@jonathannorris jonathannorris deleted the copilot/fix-225 branch June 4, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Update Cached Config Logic

5 participants