pilwon / node-ib

Interactive Brokers TWS API client library for Node.js
381 stars 133 forks source link

Wait for incoming token (advisor multi accounts) #140

Closed catch-point closed 3 years ago

catch-point commented 5 years ago

This PR skips empty tokens on in dequeue when expecting the next incoming token.

I noticed on my IB account when using request reqAccountUpdatesMulti and reqPositionsMulti commands node-ib sometimes emits the error "Unknown incoming first token: NaN" (and fails to process all incoming messages). I traced it down to an empty string in the dequeue. I think this might happen when there is a delay between TWS and the client, which is more likely to happen in advisor accounts.