Skip to content

Rejection::is(): a post-call StorageFailure is not a rejection - #9

Merged
rasuvaeff merged 2 commits into
masterfrom
fix/post-call-storage-failure
Oct 10, 2026
Merged

rasuvaeff merged 2 commits into
masterfrom
fix/post-call-storage-failure

Conversation

@rasuvaeff

Copy link
Copy Markdown
Owner

Fixes #8

CircuitBreaker::call() throws StorageFailure with operation = 'recordOutcome' after the callback has already run. 0.2.0 classified it as "rejected without an attempt", so onRejected() mapped it to the caller's "unavailable, try later" exception. That invites re-running a non-idempotent call that already reached the downstream.

  • Rejection::is() accepts StorageFailure only for admit and snapshot. Inside call(), the snapshot read happens only on the rejected-admission path.
  • recordOutcome and forceState failures pass through unmapped.
  • Data-provider cases cover all four operations, including recordOutcome with a downstreamOutcome.
  • README.md, README.ru.md, llms.txt and the onRejected() docblock are updated.
  • The retry glue is unchanged: retry still stops on every StorageFailure.

Local: composer build green, release-check green ("No backwards-incompatible changes detected" vs v0.2.0), mutation covered MSI 100%, package-audit 0/0. Released as 0.2.1.

StorageFailure from recordOutcome means the callback already ran. Mapping
it as 'rejected without an attempt' invites re-executing a non-idempotent
call. Only admit and the rejected-path snapshot failures count now.
@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cf50468f-f26b-41c9-a314-ef2ee069e2c0

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@rasuvaeff
rasuvaeff merged commit 3c59586 into master Oct 10, 2026
10 checks passed
@rasuvaeff
rasuvaeff deleted the fix/post-call-storage-failure branch October 10, 2026 11:14
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.

Rejection::is() treats a post-call StorageFailure as 'nothing was attempted'

1 participant