fix(core): throw on owner mismatch instead of silent return#36724
Open
Gawg-AI wants to merge 2 commits into
Open
fix(core): throw on owner mismatch instead of silent return#36724Gawg-AI wants to merge 2 commits into
Gawg-AI wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #36725
Type of change
What does this PR do?
Replaces the silent
returnincommitDurableEvent(non-strict owner mismatch case) withEffect.die(InvalidDurableEventError), matching the pattern used by every other mismatch check in the same function. Callers now get a real error instead of a silentundefinedthat causesreplay()to skip publishing.How did you verify your code works?
Confirmed that all other mismatch paths in
commitDurableEventalready throwInvalidDurableEventErrorviaEffect.die, and thatreplay()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