Skip to content

test: cover singleStepFallbackId == initialStepId edge case#3445

Merged
vegaro merged 1 commit into
mainfrom
facundo/workflow-fallback-self-ref-test
May 8, 2026
Merged

test: cover singleStepFallbackId == initialStepId edge case#3445
vegaro merged 1 commit into
mainfrom
facundo/workflow-fallback-self-ref-test

Conversation

@facumenzella

@facumenzella facumenzella commented May 7, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #3431.

During review of #3431 I noticed that when singleStepFallbackId points to the same step as initialStepId, 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 setDefaultPackage is effectively called on the step with its own selectedPackageInfo as input (a self-referential read from the cache). The test verifies that:

  • No crash occurs
  • ownSelection takes precedence — MONTHLY (the default-by-config package) is still returned correctly

Test plan

  • New test passes locally: singleStepFallbackId equal to initialStepId does not crash and own selection is used
  • Full PaywallViewModelWorkflowTest suite 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 PaywallViewModelWorkflowTest case covering the edge scenario where workflow.singleStepFallbackId equals initialStepId.

The test asserts updateStateFromWorkflow doesn’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.

@codecov

codecov Bot commented May 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.48%. Comparing base (17eff89) to head (fd9659d).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Base automatically changed from cesar/2026-05-03-workflow-package-context to main May 7, 2026 10:50
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>
@vegaro vegaro force-pushed the facundo/workflow-fallback-self-ref-test branch from ef46782 to fd9659d Compare May 7, 2026 15:16
@vegaro vegaro added this pull request to the merge queue May 8, 2026
Merged via the queue into main with commit 9c528fc May 8, 2026
37 checks passed
@vegaro vegaro deleted the facundo/workflow-fallback-self-ref-test branch May 8, 2026 07:17
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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants