Repository navigation
Fix swapped labels in the command type mismatch message - #97
Merged
slinkydeveloper merged 1 commit intoSep 21, 2026
Merged
Conversation
CommandTypeMismatchError printed the handler's command as what the previous execution recorded, and the recorded command as what the current execution attempts. Its callers construct it with the recorded command as `actual` and the handler's command as `expected` (RawMessage::decode_to during replay, and the lazy/eager state replay paths), so swap the two arguments in Display and document the fields. The regression test replays a recorded Run at index 1 while the handler writes output, and checks both labels in the ErrorMessage. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
slinkydeveloper
approved these changes
Sep 21, 2026
Collaborator
|
Thanks |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #96.
CommandTypeMismatchErrorprinted the handler's command as what the previous execution recorded, and the recorded command as what the current execution attempts.Every caller constructs the error with the recorded command as
actualand the handler's command asexpected:RawMessage::decode_to, whichPopJournalEntryuses during replay;This PR swaps the two arguments in
Displayand documents the fields. No caller changes.Test
journal_mismatch::command_type_mismatch_names_recorded_and_attempted_commandsreplays a recordedRunat index 1 while the handler writes output, then checks both labels in the emittedErrorMessage.recorded the following: 'handler return' (index '1')/attempts to perform the following: 'run'.Checks run locally
cargo fmt --all -- --checkcargo clippy --all-targets --workspace -- -D warnings, with default features and with--all-featurescargo test: 256 library tests pass with default features, 259 with--all-features.tests/bootstrap.rsfails locally only becauseprotocisn't installed; it fails the same way onmain, and this change doesn't touch the protocol.