Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Jan 14, 2026

Improved Type Safety for Skip-Cascade Dependencies

This PR fixes a type safety issue with the skip-cascade mode in our Flow DSL. Previously, dependencies with whenUnmet: 'skip-cascade' or retriesExhausted: 'skip-cascade' were incorrectly marked as optional for dependent steps.

The key insight is that with skip-cascade, if a step is skipped, its dependents are also skipped at runtime. This means that if a dependent handler runs at all, the parent step must have succeeded, and therefore the dependency should be required, not optional.

Changes:

  • Replaced the boolean skippable flag with a more precise SkippableMode type ('skip' | 'skip-cascade' | false)
  • Updated type helpers to only make dependencies optional when the mode is specifically 'skip' (not 'skip-cascade')
  • Fixed test cases to reflect the correct behavior
  • Added clarifying comments explaining the distinction between the two skipping modes

This change improves type safety by preventing unnecessary null checks for dependencies that are guaranteed to exist when using skip-cascade.

@changeset-bot
Copy link

changeset-bot bot commented Jan 14, 2026

⚠️ No Changeset found

Latest commit: 44482fc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud
Copy link

nx-cloud bot commented Jan 14, 2026

View your CI Pipeline Execution ↗ for commit 44482fc

Command Status Duration Result
nx run edge-worker:test:integration ✅ Succeeded 5m 15s View ↗
nx run client:e2e ✅ Succeeded 1m 11s View ↗
nx affected -t verify-exports --base=origin/mai... ✅ Succeeded 3s View ↗
nx run cli:e2e ✅ Succeeded 5s View ↗
nx run edge-worker:e2e ✅ Succeeded 40s View ↗
nx affected -t build --configuration=production... ✅ Succeeded 4s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 40s View ↗
nx run core:pgtap ✅ Succeeded 34s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-14 08:34:55 UTC

@jumski jumski force-pushed the 01-14-fix_skip-cascade_type_bug_only_skip_mode_makes_deps_optional branch from 464dab0 to 44482fc Compare January 14, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants