Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Paywalls V2] Store decoding errors in individual paywall (instead of failing entire offerings response) #4473

Merged
merged 4 commits into from
Nov 13, 2024

Conversation

joshdholtz
Copy link
Member

@joshdholtz joshdholtz commented Nov 12, 2024

Motivation

Don't error the whole offerings response if only one paywall has an error

Description

PaywallComponentsData will now silently fail with any decoding issues in the Decodable. It will store all decoding errors locally within itself for the Paywalls V2 logic to handle later by showing console logs and fallback paywalls.

The main purpose of this is so that an issue with one paywall doesn't ruin the functionality of offerings and any other paywalls.

Example

The Paywalls Tester app has been updated for this to show an error icon on paywalls that don't meet the spec. In the example below, the error s are on paywalls that are essentially in a "draft state".

We will have BE and FE server validation for paywalls schemas but this is still a good safety measure in the SDK and benefits viewing paywalls in the alpha phase in the SDK.

Screen.Recording.2024-11-11.at.9.18.45.PM.mov

@joshdholtz joshdholtz changed the title Store decoding errors in individual paywall [Paywalls V2] Store decoding errors in individual paywall (instead of failing entire offerings response) Nov 12, 2024
@joshdholtz joshdholtz force-pushed the paywalls-v2/schema-rework-part-5-soft-decoding-error branch from 7fe9c90 to 26cd38e Compare November 12, 2024 03:46
@joshdholtz joshdholtz requested review from a team November 12, 2024 03:50
@joshdholtz joshdholtz marked this pull request as ready for review November 12, 2024 03:50
Base automatically changed from paywalls-v2/schema-rework-part-4-stack-shape to main November 13, 2024 12:06
@joshdholtz joshdholtz force-pushed the paywalls-v2/schema-rework-part-5-soft-decoding-error branch from 26cd38e to f16fa6e Compare November 13, 2024 12:23
@joshdholtz joshdholtz merged commit 9ab5691 into main Nov 13, 2024
7 checks passed
@joshdholtz joshdholtz deleted the paywalls-v2/schema-rework-part-5-soft-decoding-error branch November 13, 2024 12:52
This was referenced Nov 13, 2024
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