Add WorkflowContext to surface full workflow state from PurchaseHandler#6685
Merged
Conversation
d47b420 to
2a638cc
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 2a638cc. Configure here.
2a638cc to
270b27f
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8599d27 to
983ed90
Compare
TestData has no `offering` or `offerings` members; replace with `offeringWithIntroOffer` and a local `makeOfferings` helper that mirrors the pattern in PaywallViewConfigurationTests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vegaro
approved these changes
Apr 24, 2026
5 tasks
This was referenced Apr 30, 2026
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.

Summary
WorkflowContextstruct — bundlesPublishedWorkflow, allOfferings, and the resolved initialOfferingso a multi-step view can resolve any step on the flyPurchaseHandler.resolveWorkflowContext(identifier:presentedOfferingContext:)— new internal method that surfaces the full context; the existingresolveWorkflowOfferingIdentifiernow delegates to it and discards the context, so the currentPaywallViewpath is unchangedPreviously the workflow + all offerings were fetched but immediately discarded after resolving only the initial step. This PR preserves them for
WorkflowPaywallView(PR 4b) to use when navigating to subsequent steps.Independent of PR 3 — can be reviewed in parallel.
Next: PR 4b (WorkflowPaywallView core), which depends on both this and PR 3.
Test plan
swift buildpasses (verified locally)resolveWorkflowOfferingIdentifierbehaviour is unchanged — it now delegates toresolveWorkflowContextand returns the same offering as before🤖 Generated with Claude Code
Note
Medium Risk
Touches paywall offering resolution for the workflows endpoint path; behavior is intended to be unchanged but errors/metadata propagation could affect which offering is shown when workflows are enabled.
Overview
Adds a new internal
WorkflowContextvalue that bundles the fetchedPublishedWorkflow, the fullOfferingsresponse, the resolved initialOffering, and the optionalPresentedOfferingContextfor reuse across multi-step workflow navigation.Refactors
PurchaseHandlersoresolveWorkflowOfferingIdentifierdelegates to a newresolveWorkflowContext(identifier:presentedOfferingContext:), which returns both the resolved offering and the preserved workflow context, while keeping the existing paywall path returning the sameOffering.Updates the Xcode project to include the new source and adds
WorkflowContextTeststo validatepresentedOfferingContextstorage and thatresolveWorkflowContextthrows when the workflows flag is disabled.Reviewed by Cursor Bugbot for commit b2bea40. Bugbot is set up for automated code reviews on this repo. Configure here.