Skip to content

[Conditional Configurability] Better deserialization#3146

Merged
vegaro merged 1 commit into
cesar/conditional-configurabilityfrom
cesar/conditional-configurability-better-deserialization
Feb 27, 2026
Merged

[Conditional Configurability] Better deserialization#3146
vegaro merged 1 commit into
cesar/conditional-configurabilityfrom
cesar/conditional-configurability-better-deserialization

Conversation

@vegaro

@vegaro vegaro commented Feb 26, 2026

Copy link
Copy Markdown
Member

Now that we know the JSON is not changing, adjusted the logic to be simpler. Also found we can use JSONPrimitive and simplify things a lot.


Note

Medium Risk
Changes core JSON deserialization/fallback behavior for paywall components and override conditions; malformed payloads will now preserve the declared type, which could alter fallback outcomes in edge cases.

Overview
Simplifies component override variable conditions by replacing the custom ConditionValue sealed type/serializer with a raw JsonPrimitive, and updates variable-matching logic in PresentedPartial to interpret strings/booleans/numbers directly.

Hardens SealedDeserializerWithDefault to handle non-object JSON and to preserve the discriminator type when deserialization of a known type fails (instead of losing it), with expanded tests covering malformed known types, extra/unknown fields, and null variable values. Also promotes kotlinx-serialization-json to a runtime dependency in revenuecatui since JsonPrimitive parsing is now used in production code.

Written by Cursor Bugbot for commit 92e8e9a. This will update automatically on new commits. Configure here.

@vegaro vegaro requested a review from a team as a code owner February 26, 2026 17:18
@vegaro vegaro force-pushed the cesar/conditional-configurability-better-deserialization branch from 8a41e11 to 92e8e9a Compare February 26, 2026 17:19
implementation(libs.commonmark)
implementation(libs.commonmark.strikethrough)

implementation(libs.kotlinx.serialization.json)

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.

we already do this in the main module

@RevenueCat-Danger-Bot

Copy link
Copy Markdown
1 Error
🚫 Label the PR using one of the change type labels. If you are not sure which label to use, choose pr:other.
Label Description
pr:feat A new feature. Use along with pr:breaking to force a major release.
pr:fix A bug fix. Use along with pr:force_minor to force a minor release.
pr:other Other changes. Catch-all for anything that doesn't fit the above categories. Releases that only contain this label will not be released. Use along with pr:force_patch, or pr:force_minor to force a patch or minor release.
pr:RevenueCatUI Use along any other tag to mark a PR that only contains RevenueCatUI changes
pr:next_release Preparing a new release
pr:dependencies Updating a dependency
pr:phc_dependencies Updating purchases-hybrid-common dependency
pr:changelog_ignore The PR will not be included in the changelog. This label doesn't determine the type of bump of the version and must be combined with pr:feat, pr:fix or pr:other.

Generated by 🚫 Danger

@vegaro vegaro requested a review from facumenzella February 26, 2026 17:21

@facumenzella facumenzella 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.

I like this

@vegaro vegaro merged commit 50c68c4 into cesar/conditional-configurability Feb 27, 2026
27 of 28 checks passed
@vegaro vegaro deleted the cesar/conditional-configurability-better-deserialization branch February 27, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants