Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize network calls wrt. game-state handling in the game view #269

Closed
merowin opened this issue Jun 10, 2024 · 4 comments
Closed

Optimize network calls wrt. game-state handling in the game view #269

merowin opened this issue Jun 10, 2024 · 4 comments

Comments

@merowin
Copy link
Collaborator

merowin commented Jun 10, 2024

See this conversation:

If we want to nit pick on efficiency, there are also a few low-hanging network issues I think we could also leave as follow-up tasks:

  • Two state requests are sent on page load.
Screenshot 2024-06-09 at 6 05 38 PM
  • Taking a seat sends N "unsubscribe" messages, we should only need to send 1.
Screenshot 2024-06-09 at 6 05 18 PM
  • Two state messages are sent from the server when game state changes (I believe this is because the client subscribes to both the observer state and seat-specific state.
Screenshot 2024-06-09 at 6 05 12 PM

Originally posted by @benjaminpjones in #267 (comment)

@merowin
Copy link
Collaborator Author

merowin commented Oct 16, 2024

This is probably fixed with #297

@benjaminpjones
Copy link
Collaborator

Oh yeah! The second two are definitely resolved. Is the first?

Two state requests are sent on page load.

@merowin
Copy link
Collaborator Author

merowin commented Oct 18, 2024

Oh right, the first is not resolved yet. The endpoint /games/:gameId/state/initial returns the variant and config, which are not included in endpoint /games/:gameId/state. I haven't checked this, but I believe this structure may have incidentally fixed #266 So I would like to keep it.

But maybe we can avoid that both api calls get triggered at the start.

@benjaminpjones
Copy link
Collaborator

That's a good point! And tbh two REST calls at page load is not such a big deal. Let's go ahead and close both of these, and can revisit later if API calls become an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants