Skip to content

[Paywalls V2] Added fallback components#4621

Merged
joshdholtz merged 4 commits into
mainfrom
paywalls-v2/fallback-components
Dec 30, 2024
Merged

[Paywalls V2] Added fallback components#4621
joshdholtz merged 4 commits into
mainfrom
paywalls-v2/fallback-components

Conversation

@joshdholtz

Copy link
Copy Markdown
Member

Motivation

If the type is unknown, try to parse/render a fallback component

Description

If the type is unknown for a component, look at fallback.
This should be a component a basic component that is known in initial release that all SDKs can render.

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.

This test needed fixing 😇

@joshdholtz joshdholtz marked this pull request as ready for review December 30, 2024 02:34
@joshdholtz joshdholtz requested review from a team December 30, 2024 02:38

@JayShortway JayShortway left a comment

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.

So nice! I've put this on my todo list for Android 😄 Just 1 question regarding an error message.

@@ -11,7 +11,12 @@ class ButtonComponentCodableTests: TestCase {
"type": "stack",

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.

Are the changes in this file (below) related? If so, how? 😄

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.

@JayShortway Nope! Just tests that didn't run on CI because of the feature/compiler flag so didn't see they failed a while back 🫠

XCTFail("Should have failed to decode fallback property")
} catch DecodingError.dataCorrupted(let context) {
expect(context.debugDescription).to(
contain("Failed to decode fallback for unknown type \"super_new_type\"")

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.

Shouldn't this say something like "Failed to decode unknown type without fallback"?

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.

@JayShortway Okay, I think i fixed this now in 1b41802 🤞

I also adde a test for decoding, encoding, and redecoding 🙃

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