stoqey / ib

Interactive Brokers TWS/IB Gateway API client library for Node.js (TS)
https://stoqey.github.io/ib-doc/
MIT License
205 stars 47 forks source link

Underrun error on COMPLETED_ORDER: End of message reached. Please report to https://github.com/stoqey/ib - code: 505 - reqId: -1 #223

Open icocoding opened 1 week ago

icocoding commented 1 week ago

https://github.com/stoqey/ib/blob/d521e2a448e98f45666e9c3dccf5eb6dcac705fe/src/core/io/decoder.ts#L451 In IB Gateway 10.19, an error occurred in orderDecoder.readShareholder() because the string has ended.

In the Decoder.readStr() method, if the string is no longer available, it should not throw an exception; instead, it should return null or an empty string. Additionally, in the Decoder.readBool() method, it should return a default value if the boolean is not available.