Skip to content

refactor(remote-config): Disable in CEC mode + add observability logs#3705

Merged
tonidero merged 2 commits into
mainfrom
remote_config_logs_and_disable_on_cec
Jul 3, 2026
Merged

refactor(remote-config): Disable in CEC mode + add observability logs#3705
tonidero merged 2 commits into
mainfrom
remote_config_logs_and_disable_on_cec

Conversation

@tonidero

@tonidero tonidero commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

2 main changes in this one:

  • Disable Remote Config in CEC mode
  • Add some logs to better know what remote config is doing

Note

Low Risk
Changes are gated CEC wiring plus logging and small read-path optimizations; no new network or entitlement logic for standard SDK builds.

Overview
Remote Config is no longer wired up when the SDK runs in custom entitlement computation (CEC) modeRemoteConfigManager is only created when the feature flag is on and appConfig.customEntitlementComputation is false.

Observability is expanded across the remote config stack: refresh start, 204 handling, persist/prefetch, cold reads, topic/blob resolution, blob download failover, and prefetch enqueue counts. Most of this is verboseLog; successful config receipt/persist and unchanged 204 responses use debugLog, with warnLog when a blob download succeeds but read-back fails.

Minor behavior tweaks alongside logging: topic() only waits for or triggers a sync when the topic is not already cached; inline blob extraction logs success only when write() actually stores the blob.

Reviewed by Cursor Bugbot for commit ae39abe. Bugbot is set up for automated code reviews on this repo. Configure here.

@tonidero tonidero changed the title feat(remote-config): add observability logs and disable in CEC mode refactor(remote-config): Disable in CEC mode + add observability logs Jul 3, 2026
@tonidero tonidero marked this pull request as ready for review July 3, 2026 07:52
@tonidero tonidero requested a review from a team as a code owner July 3, 2026 07:52
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.71429% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.56%. Comparing base (2710b6f) to head (ae39abe).

Files with missing lines Patch % Lines
...rchases/common/remoteconfig/RemoteConfigManager.kt 75.80% 13 Missing and 2 partials ⚠️
...ses/common/remoteconfig/RemoteConfigBlobFetcher.kt 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3705      +/-   ##
==========================================
- Coverage   80.60%   80.56%   -0.05%     
==========================================
  Files         398      398              
  Lines       16421    16473      +52     
  Branches     2347     2356       +9     
==========================================
+ Hits        13236    13271      +35     
- Misses       2249     2265      +16     
- Partials      936      937       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rickvdl rickvdl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice! :shipit:

@tonidero tonidero force-pushed the phase_6_read_facade_topic_body branch from 9d78258 to 0932eb0 Compare July 3, 2026 09:39
@tonidero tonidero force-pushed the remote_config_logs_and_disable_on_cec branch from 14a6963 to 0973813 Compare July 3, 2026 09:39
@tonidero tonidero force-pushed the remote_config_logs_and_disable_on_cec branch 2 times, most recently from 1f1434b to 72eede3 Compare July 3, 2026 11:03
@tonidero tonidero force-pushed the phase_6_read_facade_topic_body branch from ee90f08 to 3553a9b Compare July 3, 2026 11:03
@tonidero tonidero force-pushed the remote_config_logs_and_disable_on_cec branch from 72eede3 to 9110211 Compare July 3, 2026 13:35
Base automatically changed from phase_6_read_facade_topic_body to main July 3, 2026 14:43
Two related remote-config changes stacked on the read-facade work:

- Observability logs: happy-path logging across the sync flow, blob
  storage/download, and the read facade. Debug-level for lifecycle
  (refresh start, 204 not-modified, topics + items received, per-sync
  summary); verbose-level for fine-grained tracing (inline blob stored,
  blob downloaded/stored, prefetch counts, source failover, and
  body()/topic() resolution). Uses the existing debugLog/verboseLog
  helpers and the package's inline-string style; never logs blob bytes.
- Disable in custom entitlement computation mode: RemoteConfigManager is
  no longer constructed when appConfig.customEntitlementComputation is
  set, gated alongside the existing BuildConfig.ENABLE_REMOTE_CONFIG
  check in PurchasesFactory.

To keep refreshRemoteConfig under detekt's LongMethod limit, the 204
handling and the refresh-start log were extracted into handleNotModified
/ logRefreshStart helpers (behavior-preserving).

Test plan:
- ./gradlew detektAll
- ./gradlew :purchases:testDefaultsBc8DebugUnitTest --tests "com.revenuecat.purchases.common.remoteconfig.*"

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tonidero tonidero force-pushed the remote_config_logs_and_disable_on_cec branch from 9110211 to 8ee1c29 Compare July 3, 2026 15:02

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8ee1c29. Configure here.

Address Cursor Bugbot review comments on the new remote config logs:
- Gate the "Stored inlined remote config blob" success log on write() returning true
- Log a warn instead of a misleading "Resolved (0 bytes)" when a downloaded blob reads back null
- Use warnLog (not verboseLog) for a failed blob resolution

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tonidero tonidero enabled auto-merge July 3, 2026 15:12
@tonidero tonidero added this pull request to the merge queue Jul 3, 2026
Merged via the queue into main with commit 693d387 Jul 3, 2026
37 checks passed
@tonidero tonidero deleted the remote_config_logs_and_disable_on_cec branch July 3, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants