Skip to content

fix(init): avoid stale resume replays#1064

Merged
betegon merged 1 commit into
mainfrom
fix/init-stale-resume-replays
Jun 5, 2026
Merged

fix(init): avoid stale resume replays#1064
betegon merged 1 commit into
mainfrom
fix/init-stale-resume-replays

Conversation

@betegon

@betegon betegon commented Jun 4, 2026

Copy link
Copy Markdown
Member

Summary

Stops sentry init from replaying state-changing workflow resumes after timeouts or stale-resume conflicts. Recovery now observes the current run state, ignores snapshots that still show the exact same suspended payload, and only continues once the run reaches a terminal state or a genuinely advanced suspension.

Changes

  • Disable Mastra client retries for init workflow calls
  • Replace resume retrying with run-state recovery for stale or ambiguous failures
  • Prefer active suspended step payloads and avoid historical stale payload fallback
  • Compact _prevPhases so prior file contents are not resent through apply-codemods recovery

Test Plan

  • pnpm exec vitest run test/lib/init/wizard-runner.test.ts
  • pnpm exec biome check --no-errors-on-unmatched src/lib/init/wizard-runner.ts src/lib/init/types.ts test/lib/init/wizard-runner.test.ts

Rollout

Pairs with getsentry/cli-init-api#172. Land and deploy the server change first so released clients stop treating stale resume conflicts as retryable 5xx responses.

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1064/

Built to branch gh-pages at 2026-06-05 09:54 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@betegon betegon marked this pull request as ready for review June 4, 2026 10:16
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 97.98%. Project has 4762 uncovered lines.
✅ Project coverage is 81.62%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
src/lib/init/wizard-runner.ts 97.98% ⚠️ 2 Missing and 5 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    81.54%    81.62%    +0.08%
==========================================
  Files          369       369         —
  Lines        25845     25907       +62
  Branches     16888     16933       +45
==========================================
+ Hits         21074     21145       +71
- Misses        4771      4762        -9
- Partials      1770      1768        -2

Generated by Codecov Action

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 06301f2. Configure here.

Comment thread src/lib/init/wizard-runner.ts
@betegon betegon force-pushed the fix/init-stale-resume-replays branch from 06301f2 to 5e84078 Compare June 4, 2026 10:24
@betegon betegon marked this pull request as draft June 4, 2026 10:24
Comment thread src/lib/init/types.ts
@betegon betegon marked this pull request as ready for review June 4, 2026 20:13
@betegon betegon force-pushed the fix/init-stale-resume-replays branch 3 times, most recently from 42984ba to e521c8a Compare June 5, 2026 09:44
Comment thread src/lib/init/wizard-runner.ts
Comment thread src/lib/init/wizard-runner.ts
@betegon betegon force-pushed the fix/init-stale-resume-replays branch from e521c8a to 821d48e Compare June 5, 2026 09:53
@betegon betegon merged commit 716962b into main Jun 5, 2026
29 checks passed
@betegon betegon deleted the fix/init-stale-resume-replays branch June 5, 2026 10:20
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.

1 participant