Merged
Conversation
|
This pull request is automatically deployed with Now. |
james9909
reviewed
Apr 9, 2019
Member
james9909
left a comment
There was a problem hiding this comment.
Add a changelog entry, and we should be good to go!
Contributor
Author
|
Also tested this on Now with Eddie's iPad - it correctly reports that the socket is disconnected, then connecting, then connected again after the device is awoken from sleep. |
james9909
approved these changes
Apr 9, 2019
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.
My hope is that this rewrite will help eliminate the 404s we've been seeing at random. My best guess (or, hunch, really) as to why it's happening is a race condition of some kind, which hooks are better at avoiding. We also explicitly maintain our own loading state in the component. Again, this is just a hunch, and we'll have to see if the anecdotal reports of 404s stop after this.Turns out my initial hunch was totally wrong. Eddie figured out how to reproduce the 404 bug:
It appears as though Safari kills socket connections when Safari isn't in the foreground. When that would happen, we'd get an error event, which (due to my bad error handling) would cause another error. That error would get picked up by React and rendered as our custom error page by Next.js. Unfortunately, our custom error page didn't work well for this use case, because it would default to showing a misleading 404 if a status code wasn't present on the error (which it wasn't, in this case).
So, this PR does a few things to address these issues:
Given the context of the original problem, would be awesome if people have iOS devices to test with.
Also fixes or enhances a few other things:
ids ofactiveStaffmodels weren't being included in the "get queue" response; adds test to prevent future regressions