Fix incorrect handling of data responses in msgbus#3310
Merged
Conversation
…for `DataResponse` variants
…t response sending in data actor tests
Martingale42
pushed a commit
to Martingale42/nautilus_trader
that referenced
this pull request
Mar 20, 2026
arif-b-khan
pushed a commit
to arif-b-khan/nautilus_trader
that referenced
this pull request
May 29, 2026
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.
Pull Request
NautilusTrader prioritizes correctness and reliability, please follow existing patterns for validation and testing.
CONTRIBUTING.mdand followed the established practicesSummary
Fix Message Bus TypeId Mismatch Bug
All data request/response flows were incorrect -
request_instrument(),request_quotes(),request_trades(), etc. failed across all adapters.Root Cause
send_response()was passing&DataResponse(enum wrapper) to handlers expecting&InstrumentResponse(inner type):When handler tried to downcast:
The Fix
Unwrap the enum before passing to handler:
Why Tests Didn't Catch It
Tests used a different function that bypassed
send_response():How Data engine code actually works
The data engine shows the correct production usage pattern:
crates/data/src/engine/mod.rs:720-737The data engine receives a
DataResponseand callssend_response(&resp).Solution: Deleted
response()function and refactored tests to usesend_response()with wrappedDataResponse:Impact
Type of change
Testing
Ensure new or changed logic is covered by tests.