Commit Graph
9 Commits
Author SHA1 Message Date
Rick f0eaeff7fe feat(remote-config): use the server clock for X-RC-Last-Refresh-Time (#7314)
* Use server time for remote config refreshes

* Assert production remote config request dates

* Clarify remote config refresh timestamps

* Test production refresh time round trip
2026-07-30 15:10:49 +02:00
Rick f620703c93 feat(remote-config): send X-RC-Last-Refresh-Time on config requests (#7308)
* Add config last refresh header

* Refine remote config refresh header

* Address remote config refresh header reviews

* Sign final merged request headers

* Snapshot remote config refresh time

* Improve remote config refresh timestamp tests
2026-07-29 16:39:22 +02:00
Rick 5e6d58abf2 Avoid decoding legacy paywall components for workflows (#7264)
* Avoid decoding paywall components with remote config

* Preserve offerings cache when remote config disables

* Prevent stale offerings cache writes after remote config disable

* Clarify offerings decoding mode naming

* Separate offerings fetch data from cached contents

* Address offerings cache review feedback

* Require explicit cache decoders

* Test offerings cache version compatibility
2026-07-27 10:21:57 +02:00
Antonio PallaresandCursor 4436c59d92 perf(remote-config): cache persisted config in memory in RemoteConfigDiskCache (#7136)
* perf(remote-config): cache persisted config in memory on RemoteConfigDiskCache

Keep an in-memory copy of the persisted RemoteConfiguration so read() and
topic(_:) don't hit disk on every call. It's reset to the new value on write
and cleared on clear(), and lazily loaded from disk on the next read.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(remote-config): distinguish not-loaded from empty with CacheState enum

Use a CacheState enum (notLoaded / loaded) so read() only hits disk once,
including when nothing is persisted, instead of re-reading on every call.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(remote-config): name the in-memory cache `snapshot` to match Android

Aligns naming with purchases-android's RemoteConfigDiskCache in-memory snapshot.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(remote-config): cover snapshot caching of read misses

Verify a decoding failure and a missing file both cache the miss, so the
disk is only read once even if the persisted file changes afterwards.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(remote-config): only update in-memory snapshot when write succeeds

Avoid serving a configuration from memory that failed to persist to disk.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(remote-config): update disk and snapshot atomically in write/clear

Perform the disk mutation and snapshot update under the snapshot lock so
concurrent reads can't observe a torn state (disk changed but snapshot stale),
and keep a consistent lock order (snapshot then cache) across read/write/clear.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 09:47:59 +02:00
Rick 5fe329ff64 feat(remote-config): add APIs for reading topic/blob data from RemoteConfigManager (#7134)
* feat(remote-config): add read facade for blob data

* docs(remote-config): document read facade APIs

* refactor(remote-config): clarify refresh waiter continuations

* docs(remote-config): document manager refresh state

* fix(remote-config): update purchases test manager mock

* fix(remote-config): read facade cache data off caller executor

* fix(remote-config): avoid async work in nimble autoclosures

* fix(remote-config): honor disabled state after topic reads

* fix(remote-config): avoid async unwrap autoclosures

* test(remote-config): fix disabled blob read assertion

* refactor(remote-config): move topic store protocol near disk cache

* fix(remote-config): stop reads after manager closes

* fix(remote-config): avoid repeated read refreshes

* fix(remote-config): guard committed reads against cache clears

* test(remote-config): make stale read tests deterministic
2026-07-06 09:34:12 +02:00
Rick c5edb79ef2 feat(remote-config): wire up remote config manager behind feature flag (#7130)
* feat(remote-config): wire manager behind feature flag

* fix(remote-config): only mark refresh fresh after cache write
2026-07-03 13:48:39 +02:00
Rick 903e5d1197 feat(remote-config): persist full topic index (#7110) 2026-07-01 17:34:07 +02:00
Rick 5dfec8d1ae feat(remote-config): store inlined blobs to disk (#7073)
* feat(remote-config): add blob store

* fix(remote-config): prune blobs after cache write

* fix(remote-config): filter inline blobs by referenced refs

* fix(remote-config): align blob persistence with android

* feat(remote-config): sync blob storage with Android fixtures

* fix(remote-config): guard blob pruning against malformed refs

* perf(remote-config): avoid repeated blob store reads

* fix(remote-config): ignore malformed refs when pruning blobs
2026-06-29 12:52:10 +02:00
Rick 52f0ee8308 feat(remote-config): add manifest disk persistence (#7076)
* feat(remote-config): add manifest disk cache

* fix(remote-config): log missing manifest cache directory

* fix(remote-config): use snake case manifest cache path

* fix(remote-config): address manifest cache review feedback

* refactor(remote-config): reuse synchronized cache for manifest persistence

* refactor(remote-config): expose synchronized cache URL

* refactor(remote-config): simplify cache write logging

* test(remote-config): clean resolved cache directory

* refactor(remote-config): split atomic cache writes from manifest persistence

* test(remote-config): cover shared cache overwrites

* refactor(remote-config): store manifest as string

* refactor(remote-config): keep synchronized cache URL private

* fix(remote-config): preserve atomic cache writes
2026-06-25 17:50:17 +02:00