Repository navigation
perf: increase remote config throttle to 15 minutes - #613
Merged
Merged
Conversation
ianmeyer
marked this pull request as ready for review
November 25, 2026 19:16
crleona
approved these changes
Nov 25, 2026
Honor the cooldown for startup subscriptions and refreshes using persisted config and in-memory fetch results. Use absolute timestamp age for clock rollback safety and inject Time for deterministic tests.
ianmeyer
force-pushed
the
ianmeyer/rc-throttle-fifteen
branch
from
November 25, 2026 19:58
d57b2ec to
4544ca0
Compare
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.
Describe what this PR is addressing
Remote config used a five-minute refresh window, and the first subscription after a process restart could fetch again even when a recent successful response was already cached.
Describe the solution
Apply a 15-minute cooldown to subscriptions and refreshes. Reuse fresh persisted config after a restart, and honor recent in-memory successes when storage fails. Use the absolute timestamp difference so a clock rollback cannot keep an old fetch fresh indefinitely.
Steps to verify the change
Run
./gradlew :analytics-core:test :analytics-core:apiCheck :analytics-core:ktlintCheck. Regression tests cover restart behavior, the cooldown boundary, clock changes, storage failures, and concurrent refreshes.Useful links and documentation (optional)
SDKA-167
Checklist
Note
Medium Risk
Changes fetch timing and subscribe/refresh behavior for session replay and other internal remote-config consumers; wider cooldown and cache reuse reduce server load but delay how quickly new config can be picked up.
Overview
Android remote config now enforces a 15-minute cooldown (up from 5 minutes) on both
subscribeandupdateConfigs(), cutting duplicate network calls after a successful fetch.Fresh config is reused without a new request: persisted cache survives process restarts and is delivered as
CACHEwith the original timestamp (reusing does not reset the cooldown). In-memory successes still throttle when disk write or read fails.WaitForRemotereturns fresh cache immediately instead of always waiting on the network;Allonly hits the network when cache is missing or stale.Cooldown checks use an injectable
Timehelper andabs(now - timestamp)so clock skew cannot treat an old fetch as still fresh.updateConfigs()also skips when an in-memory success is still within the window. Docs and tests cover restart behavior, boundaries, clock changes, storage failures, and concurrent refreshes (RemoteConfigCooldownTest).Reviewed by Cursor Bugbot for commit 4544ca0. Bugbot is set up for automated code reviews on this repo. Configure here.