Better handling of Failed to Fetch error on Batch Change views
Created by: evanweible-wf
- Sourcegraph version: 3.35.1
- Platform information: I don't have this info readily available, but it's on our new Workiva deploy and I can have someone get this info or help debug if needed.
Steps to reproduce:
- Open a Batch Change (either a preview or an applied, active one)
- Leave the tab open for a while (not sure how long it actually takes)
- Come back to this error:
Failed to load resource: net::ERR_NETWORK_CHANGED
react-dom.production.min.js:209 TypeError: Failed to fetch
at u._subscribe (app.d26f27176a7c70acd5cc.bundle.js:1236:746118)
at u._trySubscribe (app.d26f27176a7c70acd5cc.bundle.js:1236:732734)
at u.subscribe (app.d26f27176a7c70acd5cc.bundle.js:1236:732542)
at i.call (app.d26f27176a7c70acd5cc.bundle.js:1236:758018)
at u.subscribe (app.d26f27176a7c70acd5cc.bundle.js:1236:732413)
at i.call (app.d26f27176a7c70acd5cc.bundle.js:1236:758018)
at u.subscribe (app.d26f27176a7c70acd5cc.bundle.js:1236:732413)
at a.notifyNext (app.d26f27176a7c70acd5cc.bundle.js:1236:763901)
at s._next (app.d26f27176a7c70acd5cc.bundle.js:1236:743567)
at s.next (app.d26f27176a7c70acd5cc.bundle.js:1236:738683)
no @ react-dom.production.min.js:209
/.api/graphql?GetTemporarySettings:1 Failed to load resource: net::ERR_NETWORK_CHANGED
hostReportError.ts:7 Uncaught Error: Failed to fetch
at new t (app.d26f27176a7c70acd5cc.bundle.js:1236:55558)
at app.d26f27176a7c70acd5cc.bundle.js:1236:45220
at n (app.d26f27176a7c70acd5cc.bundle.js:1236:13237)
at app.d26f27176a7c70acd5cc.bundle.js:1236:13162
at new Promise (<anonymous>)
at Object.then (app.d26f27176a7c70acd5cc.bundle.js:1236:13128)
at Object.error (app.d26f27176a7c70acd5cc.bundle.js:1236:13247)
at w (app.d26f27176a7c70acd5cc.bundle.js:1236:837879)
at E (app.d26f27176a7c70acd5cc.bundle.js:1236:838336)
at e.t.error (app.d26f27176a7c70acd5cc.bundle.js:1236:838921)
Expected behavior:
I'm guessing this happens as the batch change is trying to fetch updated info periodically, and something causes it to fail.
When fetching updated batch change data/state fails, I'd expect:
- At least one retry before showing me the error, if possible.
- A more graceful handling of the error. I'd likely still want to know that something failed and that what I'm seeing may be outdated, but I don't want the entire batch change UI to be replaced by this UI. I'd much rather have a slightly outdated view still available since I often just use it as a launching point to open the individual changesets. At the very least, I should still be able to see which Batch Change I was viewing.
- If enough information about the fetch failure is known, provide a more useful/immediate call-to-action. For example, if it's auth-related (session expired), provide a button to re-authenticate and then redirect me back to the page I was on (similar to GitHub's reauthentication flow).
Actual behavior:
After having a Batch Change open for a while, it's almost a guarantee that when I return to the tab, it will have this "Failed to Fetch" error with no other info. I'm unable to see which Batch Change I had open and I have to refresh the page.