Repository navigation
[No QA] Add context and more specific logs for various fetch errors - #8613
Conversation
Improve logging for various network conditions Add check for Auth going down Throw Error instead of TypeError Update failed to fetch error
ffd606e to
b928f6f
Compare
roryabraham
left a comment
There was a problem hiding this comment.
Overall more logs are good and it seems like you've done thorough research here. Like the idea of logging an alert to learn more about unhandled errors.
| } | ||
|
|
||
| // If we did not throw and we have a persisted request that was cancelled or for an unknown error remove it so it is not retried | ||
| if (persisted) { |
There was a problem hiding this comment.
Are you sure we don't want this for other unknown errors? Said differently, I see that you're only removing persisted requests for REQUEST_CANCELLED errors, but no others. Why did you choose that error only?
Is it because the other errors suggest that the request might be "retryable"?
There was a problem hiding this comment.
I see that you're only removing persisted requests for REQUEST_CANCELLED errors, but no others. Why did you choose that error only?
Because this is the only error that truly should never be retried.
For the rest of them, if they are destined to fail the worst case is we'll retry them 10 times and they'll fail.
We are looking into more specific retry logic for the Network Improvements doc so I expect this "retry everything" strategy will be improved on in the future.
I initially thought it would be a good idea to avoid retrying things that failed for unexplained reasons, but after looking into all these different errors I didn't come across any that obviously shouldn't be retried. That makes me think the default should be to retry everything vs. only retry the knowable things. More or less... my first instinct was wrong here and I am just putting things back while the way they were while we improve the retry system.
| NETWORK_REQUEST_FAILED: 'Network request failed', | ||
| SAFARI_DOCUMENT_LOAD_ABORTED: 'cancelled', | ||
| FIREFOX_DOCUMENT_LOAD_ABORTED: 'NetworkError when attempting to fetch resource.', | ||
| IOS_NETWORK_CONNECTION_LOST: 'The network connection was lost.', |
There was a problem hiding this comment.
Is it possible to distinguish these NETWORK_CONNECTION_LOST errors by their status code or something other than the message? If Safari surfaces https errors with messages translated based on the device, it seems like doing error handling based on that message will be unreliable. We can't / won't try to catch the message in every language, so I wonder if we should just not include these Russian and Swedish error messages at all?
Overall you have more context about these errors than I do.
There was a problem hiding this comment.
I have no idea if there is any additional information available or if it's possible to identify these errors by anything other than the message string. I only know about these because we are logging them.
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by @marcaaron in version: 1.1.57-0 🚀
|
|
🚀 Deployed to production by @chiragsalian in version: 1.1.57-17 🚀
|
Details
fetch()throws all sorts of errors and in an effort to understand what they might mean I have been looking into them and adding more context about them, whether they can be retried, etc. This is in part related to the changes in Network Improvements.reponse.statuswhich is missingTo do:
Fixed Issues
$ #8517
Tests
sudo service auth stop555 Timeoutsomewhere in the auth code (likecreateAction())Socketerror and retriedPR Review Checklist
PR Reviewer Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesSTYLE.md) were followed/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)QA Steps
No QA