Skip to content

fix: preload localized images and video override fallbacks for Paywalls V2#6752

Closed
facumenzella wants to merge 2 commits into
mainfrom
worktree-groovy-noodling-marble
Closed

fix: preload localized images and video override fallbacks for Paywalls V2#6752
facumenzella wants to merge 2 commits into
mainfrom
worktree-groovy-noodling-marble

Conversation

@facumenzella

@facumenzella facumenzella commented May 8, 2026

Copy link
Copy Markdown
Member

Why

Port of purchases-android#3449.

Two preloading gaps in Paywalls V2:

  1. LocalizationData missing .video case — if a localization key held a ThemeVideoUrls value, decoding the whole locale dictionary would throw a typeMismatch error and the locale would silently fall back to [:]. Now the .video case is decoded correctly (and skipped during image preloading, same as .string).

  2. VideoComponent override fallback images not preloadedVideoComponent.imageUrls only returned the base fallbackSource image. Override-level fallbackSource values (e.g. a different image for compact layout) were missed. Both are now collected.

Carousel page image preloading (also part of the Android PR) was already correct on iOS.

Changes

  • PaywallComponentsData.LocalizationData: add case video(ThemeVideoUrls) with decode/encode support
  • PaywallV2CacheWarming: handle .video in the localization switch; extend VideoComponent.imageUrls to include override fallback URLs
  • New test files:
    • LocalizationDataDecodingTests — string / image / video decoding + whole-dict regression
    • PaywallV2ImageURLTests — localized image, video fallback, video override fallback, and both together

Note

Medium Risk
Updates paywall UI response decoding and cache-warming URL collection, which could affect Paywalls V2 rendering/preloading behavior if the new .video localization variant is mis-decoded. Changes are covered by new unit tests and are scoped to asset preloading paths.

Overview
Fixes two Paywalls V2 preloading gaps by extending PaywallComponentsData.LocalizationData to support a .video(ThemeVideoUrls) variant (including encode/decode) and ensuring cache warming skips localized videos instead of failing decoding.

Also expands VideoComponent image preloading to include override-level fallbackSource images (in addition to the base fallback), and adds regression/unit tests for localization decoding and image URL collection.

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

…ls V2

- Add `LocalizationData.video` case so video-typed localization keys decode correctly instead of silently dropping the whole locale dict
- Extend `VideoComponent.imageUrls` to include override-level fallback images
- Add regression tests for both fixes

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

Copy link
Copy Markdown
Member Author

Closing this because it's not critical. We'll work on it again when the time comes cc @vegaro

@facumenzella facumenzella deleted the worktree-groovy-noodling-marble branch May 11, 2026 05:27
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.

1 participant