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

Dispatch network fail actions for more failed fetches. #824

Merged
merged 1 commit into from
Oct 9, 2017

Conversation

ranweiler
Copy link
Contributor

Closes #775.

Until now, we only dispatched ..._NETWORK_FAIL actions when a fetch
failed and the browser deemed it a network error of a certain kind,
per the message property of the thrown error. However, we shouldn't
assume that all browsers will set the error's message property in
the same way, and we should recover robustly when we are unable to
parse JSON from the response body (e.g. due to an error at the level
of a reverse proxy server).

By being too picky about what the thrown error looked like, we were
failing to clean up after certain kinds of non-HTTP/network error,
which was usually asymptomatic, but in the case of ballot manifest and
CVR export uploads, could lead to a "stuck" spinner state. These
changes fix that.

Closes #775.

Until now, we only dispatched `..._NETWORK_FAIL` actions when a fetch
failed and the browser deemed it a network error of a certain kind,
per the `message` property of the thrown error. However, we shouldn't
assume that all browsers will set the error's `message` property in
the same way, and we should recover robustly when we are unable to
parse JSON from the response body (e.g. due to an error at the level
of a reverse proxy server).

By being too picky about what the thrown error looked like, we were
failing to clean up after certain kinds of non-HTTP/network error,
which was usually asymptomatic, but in the case of ballot manifest and
CVR export uploads, could lead to a "stuck" spinner state. These
changes fix that.
@ranweiler ranweiler merged commit f3d0ea2 into master Oct 9, 2017
@ranweiler ranweiler deleted the fetch-exc branch October 9, 2017 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spinner doesn't go away until you log off for 33K or more CVRs (in Chrome)
2 participants