-
Notifications
You must be signed in to change notification settings - Fork 0
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
ResetWithoutClosingHandshake #6
Comments
Let me explain. React.js has a hook called useEffect() take two parameters. The first is the actual function that is maintained, and the second is an array (optional) that you input state that, if changed, should RE-RENDER. For example, say you want to store the data from a websocket as a state. You do NOT want it to RE-RENDER if you setState(), since it would CONTINUOUSLY RE-RENDER. This means, it would open a new websocket connection over, and over, and over again. I am an idiot, and did not understand that if you don't pass the array, it forces React to make all the dependencies re-render. As a result, I removed the array in a previous commit, and things immediately failed as React opened a websocket over and over and over again. By passing in the empty array, it signifies that you have no dependencies. This system is opt-out, not opt-in by default. I apologize for overlooking such a critical error, and am glad that we can finally close this. |
When the frontend attempts to start the websocket, it is met with error code 1006. The backend, on the other hand, recieves the error "ResetWithoutClosingHandshake".
So far, we have been unable to solve this issue, and the entire application is broken as a result. We have reviewed our codebase multiple times but either we are unable to find the bug, or this is not an issue on our part.
The text was updated successfully, but these errors were encountered: