Skip to content

fix: Count store-failed as a refusal of a write, since the server sends it only for writes that it refuses before storing them. - #187

Merged
goloroden merged 1 commit into
mainfrom
fix/store-failed-refusal
Oct 24, 2026
Merged

goloroden merged 1 commit into
mainfrom
fix/store-failed-refusal

Conversation

@goloroden

Copy link
Copy Markdown
Member

Through the v2 API, a failed write counted as refused, so certainly not stored, if the server reported an error in the body of its answer, except for store-failed, which counted as an unknown outcome. That exception was wrong: the server sends store-failed only from its gatekeeper, which refuses every write before storing anything once its store has failed, until the database is restarted. The write during which storing actually fails gets the raw failure of the storage, which carries no code: a status 500 before the first heartbeat, or a stream without its terminal item after it. Both stay an unknown outcome.

So every error in the body now counts as a refusal, ErrorCode::STORE_FAILED included, for writing events and for registering an event schema. The statuses, the v1 rules, and a stream that ends without its terminal item stay as they were. The tests expect store-failed to throw the DbApiException itself.

QA is green against latest and preview.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Svp844n6XkEuoe7y6zEFtF

…ds it only for writes that it refuses before storing them.

The server reports store-failed once its store has failed before, for every later write that it refuses until it is restarted. A write during which storing fails gets an error without a code, a 500 or a stream without its end item, which stays an unknown outcome.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Svp844n6XkEuoe7y6zEFtF
@goloroden
goloroden requested a review from a team as a code owner October 24, 2026 08:26
@goloroden goloroden self-assigned this Oct 24, 2026
@goloroden
goloroden merged commit 7a62a2d into main Oct 24, 2026
11 checks passed
@goloroden
goloroden deleted the fix/store-failed-refusal branch October 24, 2026 08:29
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