Pipeline job contents disappear due to network changes
I'm looking at a pipeline job URL, something ending in -/jobs/633333
, scrolling through the logs and suddenly all contents disappear and I'm confronted with an error message:
An error occurred while fetching the job.
The message is rendered as an overlay which can be closed. But nothing happens after closing it:
In the Chrome developer console I can see this:
Failed to load resource: net::ERR_NETWORK_CHANGED
Failed to load resource: net::ERR_NAME_NOT_RESOLVED
[...]
Failed to load resource: net::ERR_NAME_NOT_RESOLVED
It tries and fails to access -/jobs/633333.json
.
I can confirm that my network changed because the VPN got reconnected. However I didn't touch anything, I didn't try to refresh and I don't see why this causes the whole job to be cleared with an error.
I could imagine two ways to improve this:
- Leave the job contents alone if there's no new contents
- Clarify the error, for example
Automatic refresh of job details failed
. Although I don't know what it really tried to do, I'm just observing that it's not about initially fetching the job, considering I was already looking at that.
Proposal
If an error occurs while fetching the job log during polling (previous log data existed), show error but do not reset the job log state. This should handle the use-cases for empty state as well as an error state when a log has existed.
In app/assets/javascripts/ci/job_details/store/mutations.js
handle job error by not resetting state but retaining previous log data if there is any. If not still reset job state.