Skip to content

perf: increase remote config throttle to 15 minutes - #613

Merged
ianmeyer merged 1 commit into
mainfrom
ianmeyer/rc-throttle-fifteen
Nov 25, 2026
Merged

ianmeyer merged 1 commit into
mainfrom
ianmeyer/rc-throttle-fifteen

Conversation

@ianmeyer

@ianmeyer ianmeyer commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?

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 subscribe and updateConfigs(), 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 CACHE with the original timestamp (reusing does not reset the cooldown). In-memory successes still throttle when disk write or read fails. WaitForRemote returns fresh cache immediately instead of always waiting on the network; All only hits the network when cache is missing or stale.

Cooldown checks use an injectable Time helper and abs(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.

@linear-code

linear-code Bot commented Nov 25, 2026

Copy link
Copy Markdown

SDKA-167

@ianmeyer
ianmeyer marked this pull request as ready for review November 25, 2026 19:16
@ianmeyer
ianmeyer requested a review from a team as a code owner November 25, 2026 19:16
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
ianmeyer force-pushed the ianmeyer/rc-throttle-fifteen branch from d57b2ec to 4544ca0 Compare November 25, 2026 19:58
@ianmeyer ianmeyer changed the title fix: increase remote config throttle to 15 minutes perf: increase remote config throttle to 15 minutes Nov 25, 2026
@ianmeyer
ianmeyer merged commit 72e9922 into main Nov 25, 2026
8 checks passed
@ianmeyer
ianmeyer deleted the ianmeyer/rc-throttle-fifteen branch November 25, 2026 20:26
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.

2 participants