Skip to content

fix(core): throw on owner mismatch instead of silent return#36724

Open
Gawg-AI wants to merge 2 commits into
anomalyco:devfrom
Gawg-AI:owner-mismatch-fix
Open

fix(core): throw on owner mismatch instead of silent return#36724
Gawg-AI wants to merge 2 commits into
anomalyco:devfrom
Gawg-AI:owner-mismatch-fix

Conversation

@Gawg-AI

@Gawg-AI Gawg-AI commented Jul 13, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #36725

Type of change

  • Bug fix

What does this PR do?

Replaces the silent return in commitDurableEvent (non-strict owner mismatch case) with Effect.die(InvalidDurableEventError), matching the pattern used by every other mismatch check in the same function. Callers now get a real error instead of a silent undefined that causes replay() to skip publishing.

How did you verify your code works?

Confirmed that all other mismatch paths in commitDurableEvent already throw InvalidDurableEventError via Effect.die, and that replay() relies on the return value being defined to decide whether to publish. The fix makes the non-strict owner path consistent with the rest.

Screenshots / recordings

Verification screenshot showing the diff: https://raw.githubusercontent.com/Gawg-AI/opencode/owner-mismatch-fix/.github/verification-screenshot.png

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Gawg-AI added 2 commits July 14, 2026 02:05
In commitDurableEvent, when a non-strict owner mismatch was detected
(input.ownerID !== row.ownerID), the function silently returned
undefined instead of throwing an error. This caused callers to
misinterpret the skipped event:
- replay() checked `if (committed && options?.publish)` and silently
  skipped publishing
- publishEvent() checked `if (committed)` and fell through to treat
  the event as non-durable

All other mismatch cases in the same function throw
InvalidDurableEventError. This fix makes the owner mismatch case
consistent by throwing the same error type.
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.

Bug: commitDurableEvent silently returns on owner mismatch instead of throwing

1 participant