Skip to content

feat: persist Remote Config last-known-good - #857

Closed
shameondev wants to merge 1 commit into
codex/restore-tls-verificationfrom
codex/rc-persistent-lkg
Closed

feat: persist Remote Config last-known-good#857
shameondev wants to merge 1 commit into
codex/restore-tls-verificationfrom
codex/rc-persistent-lkg

Conversation

@shameondev

@shameondev shameondev commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Outcome

Adds persistent Last Known Good (LKG) delivery for Remote Configs so a process restart plus transient API/network failure returns the last valid response before falling back to the bundled file. Also exposes the durable frozen assignment provenance.

Stacked on #856 so the release contains both persistent fallback and restored TLS certificate/hostname verification.

Reliability contract

  • scope cache entries by project key, environment, Qonversion user, and context key
  • capture identity/generation before requests; identify/logout/restore cannot save or deliver another user's response
  • reissue concurrent single/list waiters exactly once across identity transitions
  • use network success first, then persistent LKG, then bundled fallback; merge missing list contexts without replacing valid LKG with static defaults
  • fall back on transport failures, response parsing, HTTP 408/429, and 5xx; never mask cancellation, authentication, unknown SDK errors, or other 4xx
  • validate that single/list responses contain only the requested, unique context keys; preserve authoritative no-config semantics and remove stale LKG
  • cap the managed/indexed cache during normal writes at 8 scopes, 64 configs per scope, and 512 KiB total; verify index byte metadata against the actual UTF-8 envelopes and reject corrupt/oversized/duplicate-context snapshots after restart without broad deletion of unrelated preferences
  • fit large batches with a bounded newest-suffix pass rather than repeated aggregate serialization
  • commit payload, LRU index, and evictions atomically; async writes are revision-fenced
  • expose QRemoteConfigurationAssignmentType.FROZEN("frozen"), preserving UNKNOWN for future values

Verification

  • ./gradlew :sdk:testDebugUnitTest :sdk:testReleaseUnitTest detektAll
  • ./gradlew :sdk:assembleDebug :nocodes:assembleDebug :sample:assembleDebug
  • identity/race, process-restart, corruption, eviction, oversize, parsing, response classification, and Moshi enum tests
  • git diff --check

Release fence

Configurator type-3 writes remain disabled until this SDK and the corresponding Apple/Sandwich/wrapper releases are in the compatibility matrix.

@shameondev

Copy link
Copy Markdown
Contributor Author

Консолидировано в release-train PR (один PR на репозиторий). Ветка сохранена.

@shameondev shameondev closed this Aug 7, 2026
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.

1 participant