test: cover singleStepFallbackId == initialStepId edge case#3445
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3445 +/- ##
=======================================
Coverage 79.48% 79.48%
=======================================
Files 363 363
Lines 14562 14562
Branches 1979 1979
=======================================
Hits 11574 11574
Misses 2190 2190
Partials 798 798 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds a test for when the workflow's singleStepFallbackId points to the same step as initialStepId. The pre-computation guard skips re-building the step, and ownSelection must still take precedence over the self-referential defaultPackageInfo call. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ef46782 to
fd9659d
Compare
vegaro
approved these changes
May 7, 2026
github-merge-queue Bot
pushed a commit
that referenced
this pull request
May 13, 2026
**This is an automatic release.** ## RevenueCat SDK ### 📦 Dependency Updates * [RENOVATE] Update dependency gradle to v8.14.5 (#3459) via RevenueCat Git Bot (@RCGitBot) ## RevenueCatUI SDK ### ✨ New Features * Pre-warm image cache for workflow step states (#3447) via Cesar de la Vega (@vegaro) ### Paywallv2 #### ✨ New Features * Add `close_workflow` button action (#3453) via Cesar de la Vega (@vegaro) #### 🐞 Bugfixes * Fix preload VideoComponent fallback override images (#3449) via Cesar de la Vega (@vegaro) ### 🔄 Other Changes * Select blob source by priority and weighted random (#3458) via Toni Rico (@tonidero) * [AUTOMATIC] Update golden test files for backend integration tests (#3473) via RevenueCat Git Bot (@RCGitBot) * Clean up unreferenced topic files after successful remote-config refresh (#3439) via Toni Rico (@tonidero) * Cache remote config response in memory with TTL and persist to disk (#3457) via Toni Rico (@tonidero) * build(deps): bump fastlane from 2.233.1 to 2.234.0 (#3463) via dependabot[bot] (@dependabot[bot]) * Update codelabs links (#3460) via Jaewoong Eum (@skydoves) * Add RemoteConfigManager and TopicFetcher (#3437) via Toni Rico (@tonidero) * Add exit offers support to workflows (#3452) via Cesar de la Vega (@vegaro) * Update baseline profiles (#3461) via RevenueCat Git Bot (@RCGitBot) * Add network scaffolding for remote config endpoint (#3435) via Toni Rico (@tonidero) * test: cover singleStepFallbackId == initialStepId edge case (#3445) via Facundo Menzella (@facumenzella) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: this is a release/versioning update (SNAPSHOT -> final) plus docs deployment path changes, with no functional code changes beyond version constants. > > **Overview** > Finalizes the `10.6.0` release by switching all version references from `10.6.0-SNAPSHOT` to `10.6.0` (root `.version`, `gradle.properties`, `Config.frameworkVersion`, and sample/test app `libs.versions.toml` files). > > Updates documentation publishing to point at the `10.6.0` docs path (CircleCI S3 sync target and `docs/index.html` redirect), and prepends the `10.6.0` section to `CHANGELOG.md`/`CHANGELOG.latest.md`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4da1697. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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
Follow-up to #3431.
During review of #3431 I noticed that when
singleStepFallbackIdpoints to the same step asinitialStepId, the pre-computation guard (stepWithPackages.id != initialStep.id) correctly skips re-building the step, but there was no test covering this path.In this edge case
setDefaultPackageis effectively called on the step with its ownselectedPackageInfoas input (a self-referential read from the cache). The test verifies that:ownSelectiontakes precedence — MONTHLY (the default-by-config package) is still returned correctlyTest plan
singleStepFallbackId equal to initialStepId does not crash and own selection is usedPaywallViewModelWorkflowTestsuite passes🤖 Generated with Claude Code
Note
Low Risk
Low risk: adds a unit test only, with no production code changes; the main impact is tighter regression coverage around workflow default package selection.
Overview
Adds a new
PaywallViewModelWorkflowTestcase covering the edge scenario whereworkflow.singleStepFallbackIdequalsinitialStepId.The test asserts
updateStateFromWorkflowdoesn’t crash and that the initial step’s own default package selection still wins (e.g. MONTHLY) rather than being overridden by a self-referential fallback/default package lookup.Reviewed by Cursor Bugbot for commit fd9659d. Bugbot is set up for automated code reviews on this repo. Configure here.