Better offline check instead of `navigator.onLine` (as it is fairly unreliable)
See original GitHub issueIf you test offline mode by turning off your wifi or unplug your computer cable, it’s probably be fine, the plugin tell you that “There is no internet connection”.
However, I think that’s not reflecting the real situation users might get. Sometimes it’s because of provider issue, or just simply unplug the cable from the modem (wifi is still connected), Uppy failed to notify me that there is no internet. (mainly because navigator.onLine
event is not firing), and the upload is stalled after that, the pending PATCH request never get completed (yes, I’m using Tus plugin)
There must be a better way, for example, if we’re not receiving upload-progress
event for certain amount of time (eg. 30 seconds), we could inform to the user: Experiencing network interuption… and then retry the upload, rather than let it hanging forever.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:10 (7 by maintainers)
Potentially yes, although I think it’s unlikely. If a retry kicks in (e.g. because a PATCH request failed), a HEAD request must be sent first (with potential retries as well) before uploading resumes. During this time no progress event will be emitted.
Also, a few cents from my experience with progress events: Some implementations emit a progress event every X bytes (e.g. every 64KiB). So, if you have a 1KiB/s connection, it is normal to only have one progress event per minute 😃
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.