Skip to content

fix(transport): route order-bound notices by request id - #759

Open
faysou wants to merge 1 commit into
wboayue:mainfrom
faysou:fix/order-bound-notices
Open

fix(transport): route order-bound notices by request id#759
faysou wants to merge 1 commit into
wboayue:mainfrom
faysou:fix/order-bound-notices

Conversation

@faysou

@faysou faysou commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Preserve the originating request or order ID on Notice while keeping request‑less notices represented as None.
  • Send order‑bound error frames to the order update stream as classified notices instead of raw error frames that an order decoder cannot represent.
  • Classify code 399 as informational only when its message contains a line beginning with Warning:. Other code 399 messages remain order rejections.
flowchart LR
    TWS[TWS error frame] --> Decode[Decode error envelope]
    Decode --> Classify{Request ID and severity}
    Classify -- Order-bound warning --> Update[Order update stream: Notice]
    Classify -- Order-bound error --> Update
    Classify -- Request-scoped --> Request[Request subscription]
    Classify -- Request-less --> Global[Global notice stream]
Loading

Order consumers receive the request ID and severity without adding the intercepted error message type to any domain decoder.

Testing

  • cargo test -p ibapi --features sync.
  • Paper TWS forced‑rejection smoke: hard order errors remained terminal.
  • Paper TWS code 399 smoke: a warning‑form stop order remained active and could be cancelled.

- Preserve originating IDs on request and order notices
- Deliver classified notices to the order update stream
- Keep warning-form code 399 messages informational
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