Skip to content

Add BuildConfig to RevenueCat to gate workflow prewarming#3505

Merged
facumenzella merged 6 commits into
mainfrom
codex/codex-20260526-075553
May 27, 2026
Merged

Add BuildConfig to RevenueCat to gate workflow prewarming#3505
facumenzella merged 6 commits into
mainfrom
codex/codex-20260526-075553

Conversation

@facumenzella

@facumenzella facumenzella commented May 26, 2026

Copy link
Copy Markdown
Member

Summary

A customer reported about 404's on GET /v1/subscribers/<app_user_id>/workflows/<workflow_id>

  • Add BuildConfig.USE_WORKFLOWS_ENDPOINT to the :purchases module, using the existing revenuecat.useWorkflowsEndpoint property that was already used by RevenueCatUI.
  • Gate automatic workflow pre-warming in PurchasesFactory behind that core module flag.

Root Cause

PurchasesFactory always supplied a workflowPreWarmer, so every offerings fetch with a current offering called getWorkflow for that offering identifier. That created automatic workflow requests for apps that did not opt in to the workflows endpoint.


Note

Low Risk
Opt-in behavior via an existing build flag (defaults off); only reduces unsolicited network calls unless workflows are explicitly enabled.

Overview
Stops the core :purchases SDK from always pre-fetching workflows when offerings load, which was causing unwanted GET /v1/subscribers/.../workflows/... traffic and 404s for apps that never enabled workflows.

The module now exposes BuildConfig.USE_WORKFLOWS_ENDPOINT, driven by the existing revenuecat.useWorkflowsEndpoint Gradle/local property (same knob RevenueCat UI already used). PurchasesFactory.createWorkflowPreWarmer only supplies a pre-warmer when that flag is true; otherwise OfferingsManager gets null and skips background getWorkflow calls. Unit tests cover both enabled and disabled paths.

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

@facumenzella facumenzella added the pr:fix A bug fix label May 26, 2026
@facumenzella facumenzella changed the title [codex] Gate workflow prewarming May 26, 2026
@facumenzella facumenzella marked this pull request as ready for review May 26, 2026 06:32
@facumenzella facumenzella requested a review from a team as a code owner May 26, 2026 06:32
@facumenzella facumenzella requested a review from vegaro May 26, 2026 09:53
@facumenzella facumenzella changed the title Gate workflow prewarming May 26, 2026
@facumenzella facumenzella enabled auto-merge May 27, 2026 05:30
@facumenzella facumenzella added this pull request to the merge queue May 27, 2026
@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.92%. Comparing base (aa1c14c) to head (bc9242e).

Files with missing lines Patch % Lines
...otlin/com/revenuecat/purchases/PurchasesFactory.kt 81.81% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3505      +/-   ##
==========================================
+ Coverage   79.89%   79.92%   +0.03%     
==========================================
  Files         369      369              
  Lines       14875    14880       +5     
  Branches     2048     2049       +1     
==========================================
+ Hits        11884    11893       +9     
+ Misses       2158     2154       -4     
  Partials      833      833              

☔ View full report in Codecov by Sentry.
📢 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.
Merged via the queue into main with commit 1522197 May 27, 2026
36 checks passed
@facumenzella facumenzella deleted the codex/codex-20260526-075553 branch May 27, 2026 06:09
matteinn pushed a commit to matteinn/purchases-android that referenced this pull request Jun 5, 2026
**This is an automatic release.**

## RevenueCat SDK
### 🐞 Bugfixes
* Add BuildConfig to RevenueCat to gate workflow prewarming (RevenueCat#3505) via
Facundo Menzella (@facumenzella)
### Galaxy Store
#### ✨ New Features
* [Galaxy Store]: Upgrade Samsung IAP SDK to version 6.5.2 + use Maven
distribution (RevenueCat#3492) via Will Taylor (@fire-at-will)

## RevenueCatUI SDK
### 🐞 Bugfixes
* Remove `workflow_trigger` interaction event (RevenueCat#3467) via Cesar de la
Vega (@vegaro)

### 🔄 Other Changes
* build(deps): bump fastlane from 2.234.0 to 2.235.0 (RevenueCat#3506) via
dependabot[bot] (@dependabot[bot])
* [Galaxy Store]: Remove @experimental annotations from Galaxy Module
(RevenueCat#3494) via Will Taylor (@fire-at-will)
* Update baseline profiles (RevenueCat#3504) via RevenueCat Git Bot (@RCGitBot)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Version and documentation/deploy path updates only; shipped behavior
is documented in the changelog from prior merged PRs.
> 
> **Overview**
> **Automatic release** that finalizes **10.7.0** by dropping the
`-SNAPSHOT` suffix everywhere the SDK version is declared or published.
> 
> Version strings are updated in `gradle.properties`, `.version`,
`Config.frameworkVersion`, and sample/test `libs.versions.toml` files.
Docs publishing now syncs **`10.7.0`** to S3 and the docs redirect
points at `https://sdk.revenuecat.com/android/10.7.0/`. **CHANGELOG.md**
gains the **10.7.0** section (content matches the release notes already
listed for this train: workflow prewarming gated via BuildConfig, Galaxy
Store Samsung IAP 6.5.2, RevenueCatUI workflow_trigger removal, etc.).
> 
> No new product logic appears in the diff beyond the version constant
bump.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
66071a0. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
vegaro pushed a commit that referenced this pull request Jun 24, 2026
## Summary
A customer reported about 404's on `GET
/v1/subscribers/<app_user_id>/workflows/<workflow_id>`

- Add `BuildConfig.USE_WORKFLOWS_ENDPOINT` to the `:purchases` module,
using the existing `revenuecat.useWorkflowsEndpoint` property that was
already used by RevenueCatUI.
- Gate automatic workflow pre-warming in `PurchasesFactory` behind that
core module flag.

## Root Cause
`PurchasesFactory` always supplied a `workflowPreWarmer`, so every
offerings fetch with a current offering called `getWorkflow` for that
offering identifier. That created automatic workflow requests for apps
that did not opt in to the workflows endpoint.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Opt-in behavior via an existing build flag (defaults off); only
reduces unsolicited network calls unless workflows are explicitly
enabled.
> 
> **Overview**
> Stops the core `:purchases` SDK from **always** pre-fetching workflows
when offerings load, which was causing unwanted `GET
/v1/subscribers/.../workflows/...` traffic and **404s** for apps that
never enabled workflows.
> 
> The module now exposes **`BuildConfig.USE_WORKFLOWS_ENDPOINT`**,
driven by the existing **`revenuecat.useWorkflowsEndpoint`**
Gradle/local property (same knob RevenueCat UI already used).
**`PurchasesFactory.createWorkflowPreWarmer`** only supplies a
pre-warmer when that flag is true; otherwise **`OfferingsManager`** gets
`null` and skips background **`getWorkflow`** calls. Unit tests cover
both enabled and disabled paths.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
bc9242e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:fix A bug fix

2 participants