Skip to content

Conversation

@Hiro-Nakamura
Copy link
Contributor

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

  • [wip] optimize the socket responses to minimize by user

Test Status

@github-actions
Copy link
Contributor

Please add one release label:
major (for breaking changes), minor (for new features), patch (for bug fixes) or skip-release (to skip the auto release process).

@Hiro-Nakamura Hiro-Nakamura added the minor Tag Pull Requests to trigger a minor version update label Aug 21, 2024
@Hiro-Nakamura Hiro-Nakamura marked this pull request as ready for review September 19, 2024 19:34

// 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Tag Pull Requests to trigger a minor version update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants