Add ButtonComponent.Action.Workflow#3385
Conversation
| } | ||
| // Should not reach here: Action.Workflow will be handled before calling toPaywallAction. | ||
| // Reached only if componentId is null (misconfigured button). | ||
| is ButtonComponentStyle.Action.Workflow -> PaywallAction.External.NavigateBack |
There was a problem hiding this comment.
Workflow button silently dismisses paywall instead of triggering workflow
High Severity
The comment states Action.Workflow "will be handled before calling toPaywallAction," but no such interception exists anywhere in the button click path. WorkflowNavigator.triggerAction() is never called from ButtonComponentView's click handler. When a user taps a Workflow button, it unconditionally maps to PaywallAction.External.NavigateBack, which calls viewModel.closePaywall() — dismissing the paywall entirely instead of advancing the workflow. A no-op or hiding the button (returning null from convertAction like Action.Unknown) would be a safer fallback than a destructive navigation action.
Reviewed by Cursor Bugbot for commit 5b5fac0. Configure here.
There was a problem hiding this comment.
I guess this will be addressed in follow-up PRs?
There was a problem hiding this comment.
yes, I had to leave it in the when to be able to split the PR but in this file https://github.com/RevenueCat/purchases-android/pull/3380/files#diff-da3cac32a5cf63c0e97c308a03655c8d66360bd41c88d3aa05e8ae68c434a23dR50
it will not reach toPaywallAction. I don't love it though. If someone calls toPaywallAction somewhere else it will hit this PaywallAction.External.NavigateBack.
There was a problem hiding this comment.
Going to merge this as is for now, just to satisfy the when and see if I can clean it up in the other PR
tonidero
left a comment
There was a problem hiding this comment.
Looking good! Maybe just adding a comment and some tests.
| } | ||
| // Should not reach here: Action.Workflow will be handled before calling toPaywallAction. | ||
| // Reached only if componentId is null (misconfigured button). | ||
| is ButtonComponentStyle.Action.Workflow -> PaywallAction.External.NavigateBack |
There was a problem hiding this comment.
I guess this will be addressed in follow-up PRs?
| ) | ||
| } | ||
| // Should not reach here: Action.Workflow will be handled before calling toPaywallAction. | ||
| // Reached only if componentId is null (misconfigured button). |
There was a problem hiding this comment.
Should we log something in this case if it's unexpected? Also, I wonder if this is something we can catch early on, while validating the workflow/paywall...
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ab11c80. Configure here.
**This is an automatic release.** ## RevenueCat SDK ### ✨ New Features * Unified StoreReplacementMode API (RevenueCat#3234) via Will Taylor (@fire-at-will) * Add placement and targeting context to paywall events (RevenueCat#3253) via Dan Pannasch (@dpannasch) ### 🐞 Bugfixes * Fix null Placements when offering_ids_by_placement is absent (RevenueCat#3254) via Dan Pannasch (@dpannasch) ## RevenueCatUI SDK ### Paywallv2 #### ✨ New Features * Wire multipage workflow navigation into PaywallViewModel (RevenueCat#3381) via Cesar de la Vega (@vegaro) ### 🔄 Other Changes * Add `triggerType` to `WorkflowTrigger` (RevenueCat#3393) via Cesar de la Vega (@vegaro) * Extract private function `NavigateTo.toPaywallAction` (RevenueCat#3392) via Cesar de la Vega (@vegaro) * Bump revenucatui-tests gradle cache key (RevenueCat#3391) via Toni Rico (@tonidero) * Create `WorkflowTriggerType` and `WorkflowTriggerActionType` (RevenueCat#3386) via Cesar de la Vega (@vegaro) * Update baseline profiles (RevenueCat#3390) via RevenueCat Git Bot (@RCGitBot) * Plumb `componentId` through buttons on workflow interactions (RevenueCat#3380) via Cesar de la Vega (@vegaro) * Add `ButtonComponent.Action.Workflow` (RevenueCat#3385) via Cesar de la Vega (@vegaro) * Add `componentId` to `ButtonCoomponentStyle` (RevenueCat#3384) via Cesar de la Vega (@vegaro) * Migrate all suspendCoroutine usages to suspendCancellableCoroutine (RevenueCat#3365) via Jaewoong Eum (@skydoves) * Add `WorkflowNavigator` for multipage workflow step navigation (RevenueCat#3379) via Cesar de la Vega (@vegaro) * build(deps): bump fastlane-plugin-revenuecat_internal from `b822f01` to `d24ab26` (RevenueCat#3383) via dependabot[bot] (@dependabot[bot]) * Add `id` field to `ButtonComponent` (RevenueCat#3377) via Cesar de la Vega (@vegaro) * Add CI workflows for generating Baseline Profiles (RevenueCat#3372) via Jaewoong Eum (@skydoves) * add min sdk level for paywalls and customer center (RevenueCat#2465) via Muhammad-Sharif Moustafa (@mshmoustafa) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk release bookkeeping: updates version strings, changelogs, and documentation deployment targets without changing runtime logic beyond the reported version identifier. > > **Overview** > Cuts the `10.3.0` release by updating all version references from `10.3.0-SNAPSHOT` to `10.3.0` across build config (`gradle.properties`, `.version`, `Config.frameworkVersion`) and sample/test app dependency pins. > > Updates release documentation publishing to sync Dokka output to the `10.3.0` S3 path and changes `docs/index.html` to redirect to `10.3.0`. Also promotes release notes by moving `CHANGELOG.latest.md` entries into a new `CHANGELOG.md` section for `10.3.0`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 056ce62. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->


Add new type of action for the
ButtonComponentNote
Medium Risk
Moderate risk because it extends the paywall action serialization/deserialization contract and alters UI action mapping; misconfiguration could change runtime behavior for affected buttons.
Overview
Introduces a new
ButtonComponent.Action.Workflowaction and supports it in the surrogate serializer/deserializer (includingActionTypeSurrogate.workflow) with a matching unit test for JSON round-trip.Propagates this action into RevenueCatUI by adding
ButtonComponentStyle.Action.Workflow, passingcomponentIdthroughStyleFactory, excluding it from interaction/purchase-related analytics mapping, and adding a defensive fallback inButtonComponentStatethat logs an error and navigates back ifWorkflowreachestoPaywallAction().Reviewed by Cursor Bugbot for commit 1d15edb. Bugbot is set up for automated code reviews on this repo. Configure here.