Draft
Conversation
1514a99 to
a3b0302
Compare
Pull Request Test Coverage Report for Build 12440513774Details
💛 - Coveralls |
43fe8eb to
687279c
Compare
Signed-off-by: Lucas ONeil <lucasoneil@gmail.com>
Signed-off-by: Lucas ONeil <lucasoneil@gmail.com>
687279c to
daa74fa
Compare
Contributor
Author
|
Leaving this draft up for reference for now but we are looking into websocket refactoring as part of High-Availability drive. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Leaving for draft for now, want to double check all retention/removal stuff so there's no memory leak possibility.
Buffer up messages that would be sent to disconnected clients. On client reconnect (just "connect" server side still) check the buffer for the
pidfrom the client and re-emit messages.Only keep the messages in the buffer for a fixed amount of seconds (can adjust this maybe with config if needed? Or can use the same timeout as the UI maybe since the user would be prompted to try again anyways if they leave off into the wallet app too long)
Some details on Socket.io handling disconnections:
https://socket.io/docs/v4/tutorial/handling-disconnections
Socket.io does have a built in Connection State Recovery:
https://socket.io/docs/v4/connection-state-recovery
I think this would accomplish what this code does here, however it's not implemented in the Python library VCAuth uses
see: miguelgrinberg/python-socketio#1258
Maybe we shouldn't be using this library? It's a pretty simple wrapper though but could be considerations on handling web sockets in a different way. We do however need to consider that storing in-memory is not what we want forever on VCAuth and need to be able to hook into (DB likely) persistence for multi-pod deployment. The code here should be able to handle that need when we address it.
Update the python socket library too (and other python libraries), and socket.io client JS.