Resolve exit offer offering ID from workflow singleStepFallbackId#6755
Merged
Conversation
Parses the exit_offers JSON field on WorkflowScreen and passes it through WorkflowScreenMapper into PaywallComponentsData, matching the Android implementation in purchases-android#3452. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds WorkflowContext.exitOfferOfferingId, which reads exit_offers from the screen belonging to singleStepFallbackId. Returns nil when no fallback is set or the screen has no exit offer configured. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 tasks
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
Adds
WorkflowContext.exitOfferOfferingId: readsexit_offersfrom the screen belonging tosingleStepFallbackId. Returnsnilwhen no fallback step is set or the screen has no exit offer configured.Graph traversal (finding the terminal step when
singleStepFallbackIdis absent) is intentionally out of scope for now.Test plan
testExitOfferOfferingIdReturnsNilWhenNoSingleStepFallbackIdtestExitOfferOfferingIdReturnsOfferingIdFromFallbackStepScreentestExitOfferOfferingIdReturnsNilWhenFallbackStepHasNoExitOffersAll pass via
swift test --filter WorkflowContextTests.🤖 Generated with Claude Code
Note
Low Risk
Low risk: adds a read-only computed property and unit tests, without changing purchase/offer retrieval behavior or any network/auth flows.
Overview
Adds
WorkflowContext.exitOfferOfferingId, which derives an exit-offerofferingIdby followingworkflow.singleStepFallbackIdto its step’s screen and readingexit_offers.dismiss.offering_id(otherwisenil).Extends
WorkflowContextTestswith coverage for the new property, including cases for missingsingleStepFallbackId, configured exit offers, and screens without exit offers.Reviewed by Cursor Bugbot for commit 2e31b94. Bugbot is set up for automated code reviews on this repo. Configure here.