Skip to content

Extract PaywallComponentsImagePreDownloader#3448

Merged
vegaro merged 2 commits into
mainfrom
cesar/extract-paywall-predownloader
May 7, 2026
Merged

Extract PaywallComponentsImagePreDownloader#3448
vegaro merged 2 commits into
mainfrom
cesar/extract-paywall-predownloader

Conversation

@vegaro

@vegaro vegaro commented May 7, 2026

Copy link
Copy Markdown
Member

Extracted from #3447

Little refactor extracting PaywallComponentsImagePreDownloader


Note

Medium Risk
Changes paywall image predownload behavior and wiring, which could increase/alter network/cache usage for paywall assets (notably header images) and affect startup/background work.

Overview
Extracts Paywall V2 image predownload logic from OfferingImagePreDownloader into a new PaywallComponentsImagePreDownloader, and updates PurchasesFactory to create/reuse a single CoilImageDownloader and pass the new predownloader through.

Updates the image selection for Paywall V2 to include header stack assets (in addition to stack/sticky footer/background), and adjusts tests to cover the new header image/icon downloads.

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

@vegaro vegaro requested a review from a team as a code owner May 7, 2026 12:10

private fun findImageUrisToDownload(paywallComponentsConfig: PaywallComponentsConfig): Set<Uri> {
return paywallComponentsConfig.stack.findImageUrisToDownload() +
(paywallComponentsConfig.header?.stack?.findImageUrisToDownload().orEmpty()) +

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

added header here, which we were missing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented May 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.64706% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.47%. Comparing base (175c252) to head (2bb8a6e).

Files with missing lines Patch % Lines
...hases/utils/PaywallComponentsImagePreDownloader.kt 62.71% 12 Missing and 10 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3448   +/-   ##
=======================================
  Coverage   79.47%   79.47%           
=======================================
  Files         362      363    +1     
  Lines       14547    14560   +13     
  Branches     1977     1979    +2     
=======================================
+ Hits        11561    11572   +11     
  Misses       2190     2190           
- Partials      796      798    +2     

☔ 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.

import com.revenuecat.purchases.paywalls.components.common.PaywallComponentsConfig
import com.revenuecat.purchases.paywalls.components.properties.ThemeImageUrls

internal class PaywallComponentsImagePreDownloader(

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.

🍠

}
}

private fun findImageUrisToDownload(paywallComponentsConfig: PaywallComponentsConfig): Set<Uri> {

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.

The traversal is still very ad hoc and shallow. In PaywallComponentsImagePreDownloader.kt, CarouselComponent only predownloads the carousel background, not images inside pages.

From my beloved agent 💅

You can take care of this in another PR

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

nice, good catch

@vegaro vegaro added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit c830cf5 May 7, 2026
43 checks passed
@vegaro vegaro deleted the cesar/extract-paywall-predownloader branch May 7, 2026 13:06
matteinn pushed a commit to matteinn/purchases-android that referenced this pull request Jun 5, 2026
**This is an automatic release.**

## RevenueCat SDK
### 🐞 Bugfixes
* fix: url encode query prameters (RevenueCat#3451) via Jacob Rakidzich
(@JZDesign)

## RevenueCatUI SDK
### 🐞 Bugfixes
* Fix: dismiss was called before onPurchaseComplete callback invocation
(RevenueCat#3353) via Jacob Rakidzich (@JZDesign)
* Propagate default package across workflow steps (RevenueCat#3431) via Cesar de
la Vega (@vegaro)
### Paywallv2
#### ✨ New Features
* feat: Allow disabling of automatic font scaling (RevenueCat#3438) via Jacob
Rakidzich (@JZDesign)

### 🔄 Other Changes
* Extract `PaywallComponentsImagePreDownloader` (RevenueCat#3448) via Cesar de la
Vega (@vegaro)
* Simplify `WorkflowTransitionState` with explicit from/to step fields
(RevenueCat#3441) via Cesar de la Vega (@vegaro)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk release bookkeeping: primarily flips version strings from
`10.5.0-SNAPSHOT` to `10.5.0` and updates docs/changelogs, with no
functional code changes beyond the reported version constant.
> 
> **Overview**
> Cuts the `10.5.0` release by switching the project from
`10.5.0-SNAPSHOT` to `10.5.0` across build metadata (`.version`,
`gradle.properties`, sample/test app `libs.versions.toml`, and
`Config.frameworkVersion`).
> 
> Updates release artifacts and documentation pointers: CircleCI docs
deploy now syncs the `10.5.0` docs folder to S3, `docs/index.html`
redirects to `10.5.0`, and changelogs are rolled forward with the
`10.5.0` entries in `CHANGELOG.md`/`CHANGELOG.latest.md`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
48537d6. 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants