Skip to content

fix(plugin-stack-persistence): wrap save failures in StackSnapshotRecordSaveError#733

Merged
ENvironmentSet merged 1 commit into
mainfrom
fix-onRecordSaveError-call
Jul 22, 2026
Merged

fix(plugin-stack-persistence): wrap save failures in StackSnapshotRecordSaveError#733
ENvironmentSet merged 1 commit into
mainfrom
fix-onRecordSaveError-call

Conversation

@ENvironmentSet

Copy link
Copy Markdown
Collaborator

Summary

onRecordSaveError is typed as (error: StackSnapshotRecordSaveError) => void, but the save path passed the raw storage error straight through, unlike the load path which wraps with StackSnapshotRecordLoadError.

  • Wrap the caught error in StackSnapshotRecordSaveError before invoking onRecordSaveError
  • Also wrap the rethrown error when no handler is provided, so unhandled rejections are identifiable as snapshot-save failures (original error preserved as cause)
  • Add a patch changeset

🤖 Generated with Claude Code

https://claude.ai/code/session_01G8n8acsHn8MbiqE2YBwXyc

…ordSaveError

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G8n8acsHn8MbiqE2YBwXyc
@changeset-bot

changeset-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: dbccc12

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stackflow/plugin-stack-persistence Patch

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 15827f47-4a10-4318-b561-33de03137b0b

📥 Commits

Reviewing files that changed from the base of the PR and between f52b5f4 and dbccc12.

📒 Files selected for processing (2)
  • .changeset/wrap-record-save-error.md
  • extensions/plugin-stack-persistence/src/stackPersistencePlugin.ts

Disabled knowledge base sources:

  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Storage save failures are now consistently reported as StackSnapshotRecordSaveError.
    • Error handlers receive the expected error type, and unhandled save failures retain consistent behavior.

Walkthrough

The idle-save path now wraps storage failures in StackSnapshotRecordSaveError before invoking onRecordSaveError or rethrowing. A patch changeset documents the behavior.

Changes

Persistence save error handling

Layer / File(s) Summary
Wrap idle-save failures
extensions/plugin-stack-persistence/src/stackPersistencePlugin.ts, .changeset/wrap-record-save-error.md
Storage save failures are wrapped in StackSnapshotRecordSaveError for callback handling or rethrowing, with the behavior documented in a patch changeset.

Estimated code review effort: 2 (Simple) | ~5 minutes

Possibly related PRs

  • daangn/stackflow#727: Introduces StackSnapshotRecordSaveError and the initial save-path error handling updated here.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-onRecordSaveError-call

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ENvironmentSet
ENvironmentSet marked this pull request as ready for review July 22, 2026 07:37
@ENvironmentSet
ENvironmentSet enabled auto-merge (squash) July 22, 2026 07:37
@ENvironmentSet
ENvironmentSet merged commit bf5daae into main Jul 22, 2026
5 of 8 checks passed
@ENvironmentSet
ENvironmentSet deleted the fix-onRecordSaveError-call branch July 22, 2026 07:38
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