getOrders summaries assumed OpenOrder decimal fields were in-process Decimal instances, so HTTP wire responses with string fields could fail with:
order.totalQuantity.equals is not a function
This issue was observed on Alpaca. Not sure if this is a cross-broker wire-format issue. Alpaca also exposes a related order ID problem because Alpaca order IDs are UUID strings, while Order.orderId is numeric and may be 0, so summaries can lose the real broker-native order ID.
Reference:
Expected behavior:
- getOrders should handle both Decimal instances and HTTP wire string values.
- UNSET_DECIMAL sentinel values should still be omitted from summaries.
- Broker-native string order IDs should be preserved when available.
getOrders summaries assumed OpenOrder decimal fields were in-process Decimal instances, so HTTP wire responses with string fields could fail with:
order.totalQuantity.equals is not a function
This issue was observed on Alpaca. Not sure if this is a cross-broker wire-format issue. Alpaca also exposes a related order ID problem because Alpaca order IDs are UUID strings, while Order.orderId is numeric and may be 0, so summaries can lose the real broker-native order ID.
Reference:
Expected behavior: