fix: preload localized images and video override fallbacks for Paywalls V2#6752
Closed
facumenzella wants to merge 2 commits into
Closed
fix: preload localized images and video override fallbacks for Paywalls V2#6752facumenzella wants to merge 2 commits into
facumenzella wants to merge 2 commits into
Conversation
…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>
Member
Author
|
Closing this because it's not critical. We'll work on it again when the time comes cc @vegaro |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Port of purchases-android#3449.
Two preloading gaps in Paywalls V2:
LocalizationDatamissing.videocase — if a localization key held aThemeVideoUrlsvalue, decoding the whole locale dictionary would throw atypeMismatcherror and the locale would silently fall back to[:]. Now the.videocase is decoded correctly (and skipped during image preloading, same as.string).VideoComponentoverride fallback images not preloaded —VideoComponent.imageUrlsonly returned the basefallbackSourceimage. Override-levelfallbackSourcevalues (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: addcase video(ThemeVideoUrls)with decode/encode supportPaywallV2CacheWarming: handle.videoin the localization switch; extendVideoComponent.imageUrlsto include override fallback URLsLocalizationDataDecodingTests— string / image / video decoding + whole-dict regressionPaywallV2ImageURLTests— localized image, video fallback, video override fallback, and both togetherNote
Medium Risk
Updates paywall UI response decoding and cache-warming URL collection, which could affect Paywalls V2 rendering/preloading behavior if the new
.videolocalization 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.LocalizationDatato support a.video(ThemeVideoUrls)variant (including encode/decode) and ensuring cache warming skips localized videos instead of failing decoding.Also expands
VideoComponentimage preloading to include override-levelfallbackSourceimages (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.