Prevent duplicate socket updates to same user.#169
Conversation
|
Please add one release label: |
|
|
||
| // It is possible for a client to have > 1 socket connection. We only | ||
| // want to send 1 message to a client, so let's try to resolve socket.id | ||
| // to users, and then just send to each user: |
There was a problem hiding this comment.
I'm not sure I fully understand, but I think it's valid for a user to be using multiple clients (browser tabs) and expect to see updates across each client.
If the client itself is getting more than 1, that is a different problem. I think we should be looking at the creation of those sockets (and ensuring where not creating too many) rather than doing all this filtering on the broadcast.
There was a problem hiding this comment.
Well, when I first noticed it, I only had 1 browser open and it had 2 connections going. And when reviewing the logs, I saw we were sending 400 socket updates for some of the transactions. Did we have 400 users testing out the system?
But, I think you are right. If we have a client with multiple browsers open, this update would only send 1 update back, not one to each of this browsers. I'll have to find out if there is a way to specify a unique browser tab.
It is possible for a client to have >1 socket connection at a time. In those cases, we want to make sure that we only send 1 update to a user's client.
This patch will relate sockets to users and make sure each user gets 1 update.
Release Notes
Test Status