User update socket gives too many messages?

Hi All,

I’m running into the following issue where the “user” channel is giving me more information than what I expect to receive.
The following sequence is what I’ve run to reproduce the ‘issue’ that I’m having. I can handle the below mentioned information in code, but is that really correct?

  1. Open a new order
  2. Cancel the newly created order

What I expect to receive is 1 message when I open the order and 1 message that I’ve cancelled the order.

But what I receive is the following:


As you can see I’m receiving 4 messages in total, 2 messages for when I open the order. First a PENDING message and afterwards an OPEN message.
Upon cancellation I receive another 2, first an OPEN order (why?) and then a CANCELLED order.

Why is the first message upon cancellation an OPEN order, shouldn’t this also be a PENDING order to indicate I’m executing an action which is still pending?
Why is it returning me the status of the order which I have already received previously? This causes some headaches for me as I have no way of filtering this status message unless doing a check if the order has already been processed.
This seems to be inaccurate and I’m wondering how other people are handling this if not in the same manner which seems rather sloppy…

@Coinbase, is this really how you intended this websocket to work?

Hi @Okrah

The user channel sends updates on all of a user’s open orders, including all subsequent updates of those orders.

The user channel is intended to work this way, please read here for more information on how user channel works: Advanced Trade WebSocket Channels | Coinbase Cloud

1 Like

Hi @Caleb, thanks for the fast response.

I understand the initial snapshot message. That I parse accordingly. But subsequent API calls to cancel an order return 2 messages on the socket channel. All the other websockets by other exchanges don’t do this. Is there a reason why you send old irrelevant data when we do a new action?

Ok, it took me a while to figure out, but I should’ve been filtering on the ‘Type’. I can skip the message if the type belongs to “snapshot”. Thanks @Caleb for being the rubber ducky :wink: .

1 Like