CircleCI: fix snapshot generation for iOS 14#3431
Merged
Merged
Conversation
See #2421. iOS 14 + Snapshots needs a new test plan that doesn't run StoreKit tests.
ff1386b to
1ed949b
Compare
tonidero
approved these changes
Nov 17, 2023
tonidero
pushed a commit
that referenced
this pull request
Nov 30, 2023
**This is an automatic release.** ### RevenueCatUI * Paywalls: Fix navigation with close button in UIKit (#3466) via Andy Boedo (@aboedo) * `Paywalls`: `watchOS` support (#3291) via NachoSoto (@NachoSoto) ### Dependency Updates * Bump cocoapods from 1.14.2 to 1.14.3 (#3464) via dependabot[bot] (@dependabot[bot]) * Bump fastlane from 2.216.0 to 2.217.0 (#3415) via dependabot[bot] (@dependabot[bot]) * Bump danger from 9.3.2 to 9.4.0 (#3414) via dependabot[bot] (@dependabot[bot]) ### Other Changes * Some `APITester` fixes (#3444) via NachoSoto (@NachoSoto) * `HTTPClient`: test all request headers (#3425) via NachoSoto (@NachoSoto) * `CircleCI`: fix snapshot generation for iOS 14 (#3431) via NachoSoto (@NachoSoto) * Remove `MockStoreMessagesHelper` from SDK (#3417) via NachoSoto (@NachoSoto) * Enable explicit_init lint rule and fix issues (#3418) via Mark Villacampa (@MarkVillacampa)
facumenzella
added a commit
that referenced
this pull request
May 14, 2026
Each workflow step now gets its own cached PackageContext. Package-bearing steps use their own package selection; packageless steps fall back to the workflow's singleStepFallbackId context. Sheet dismissal restores the step-local selection rather than resetting to the workflow-global fallback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
facumenzella
added a commit
that referenced
this pull request
May 25, 2026
* Propagate default package per workflow step (parity with Android #3431) Each workflow step now gets its own cached PackageContext. Package-bearing steps use their own package selection; packageless steps fall back to the workflow's singleStepFallbackId context. Sheet dismissal restores the step-local selection rather than resetting to the workflow-global fallback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix P1: broadcast step-local workflowPackageContext per page Add WorkflowContext.effectivePackageContext(for:) which returns the step's own package context when it has package components, falling back to the global workflowPackageContext otherwise. WorkflowPaywallView now stores this per-page and sets it as the workflowPackageContext env value, so TabsComponentView and any other consumer automatically gets the step-scoped default rather than the global workflow fallback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix P2: remove mutable override from defaultPackage derivation After the P1 fix, workflowPackageContext in the env is the step-local stable WorkflowPackageContext struct. selectedPackageContextOverride.package is a @published var that mutates on user selection, so using it as defaultPackage caused planSelectionDefaultPackage to track the user's current selection rather than the page's configured default. Removing the override prefix restores correct, stable defaultPackage derivation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Remove redundant fallback in buildPackageContext effectivePackageContext already falls back to workflowPackageContext internally, so the trailing ?? workflowPackageContext was unreachable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Carry forward package selection on forward workflow navigation When navigating forward from step N to step N+1, step N+1 now opens with step N's current selection if that package is available there. Falls back to the workflow-global default (singleStepFallbackId), then the step's own authored default as last resort. Backward navigation is unchanged: the cached PackageContext for the previous step is returned as-is, so selection does not propagate back. Revisiting a step via forward navigation always re-derives from the current step's live selection (not a stale first-visit cache). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Don't overwrite cached step selection on revisit Once a step's PackageContext has been initialized (first visit), subsequent forward navigations to that step return the cached context unchanged. This matches Android's setDefaultPackage idempotency: a step that has already been visited keeps its selection — whether that came from a prior carry-forward or from the user tapping a package on that step. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Test: guard PackageContext reference-type invariant and buildPackageContext carry-forward - Make `buildPackageContext` internal so tests can call it directly - `testPackageContextMutationsPropagateThroughStepCacheReference`: catches any future refactoring of PackageContext from class to struct, which would silently break back-navigation selection preservation - `testBuildPackageContextCarriesForwardPreferredPackageWhenAvailableInStep`: end-to-end forward carry-forward at the WorkflowPaywallView layer - `testBuildPackageContextReturnsEmptyContextForPackagelessStepWithNoFallback`: guards the nil-effectiveContext → empty PackageContext path Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Test: cache hit takes precedence over carry-forward on step revisit Documents that `WorkflowPaywallView.renderedPageForStep` uses the cache-hit path (ignoring `carryForwardPackage`) when a step already has a `PackageContext` in `stepPackageContexts`, preserving the user's own prior selection over a new carry-forward from the previous step. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Avoid redundant workflowPackageContext scans in effectivePackageContext(for:preferring:) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Remove redundant reference-type test, consolidate into existing cache test `testPackageContextMutationsPropagateThroughStepCacheReference` only tested Swift reference semantics in isolation. The same invariant is already exercised meaningfully in `testCachedStepContextTakesPrecedenceOverCarryForwardOnRevisit`, which now carries a note pointing to the exact mutation line. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix: carry-forward selects destination step's Package object, not source step's In multi-offering workflows where two steps expose the same package identifier from different offerings, effectivePackageContext(for:preferring:) was returning the source step's Package instance directly. Switch both the preferredPackage path and the wfDefault path from contains+direct-return to first(where:) so the selectedPackage always comes from base.packages (the destination step's list). Tests: two new WorkflowContextTests cases covering each path with distinct offerings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Test RootView sheet dismissal: extract static method + add unit tests Extract sheet-dismissal package restoration into `RootView.restoredPackageAfterSheetDismissal` (static, testable) and add `RootViewSheetDismissalTests` covering workflow-context restore, nil-snapshot fallback, non-workflow-context always-default, and nil-default edge case. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Inline wfPackageContext assignment Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix workflow package context per page * Clarify package sheet snapshot naming * Precompute workflow package context * Add RootView sheet dismissal tests to Xcode project * Guard workflow package context cache invariants * Clarify workflow package context cache inputs * Guard back navigation cache invariant * Split back-navigation rendering path * Avoid crashing on missing back-navigation cache * Remove dead selectedPackageContextOverride stored property The property was set in init but never read — the init body at line 149 already uses the parameter directly (still in scope), so self.selectedPackageContextOverride was unreachable dead weight holding an unnecessary strong reference. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Address workflow navigation review comments * Remove unused workflow package context overload --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
See #2421.
iOS 14 + Snapshots needs a new test plan that doesn't run StoreKit tests.