ipfs-companion icon indicating copy to clipboard operation
ipfs-companion copied to clipboard

Track URLs that failed to load because gateway was down.

Open whizzzkid opened this issue 3 years ago • 1 comments
trafficstars

Is your feature request related to a problem? Please describe. As part of #1092, we now have capability to reload the pages that failed to load because the gateway was offline. The check involves matching tab titles to validate if the page has content or did it fail. While this works, it won't work with non-english browsers or break in the future because the browsers could change the wording. I would like to improve the functionality to something like what @lidel suggested in the thread.

Describe the solution you'd like

  • Attach a listener to onErrorOccurred from src/lib/ipfs-request.js.
  • Add isRecoverableViaOnlineApi which stores failed requests to local gateway in a cache similar to errorInFlight.
  • Then, I could check if url is present in that cache, removing the need for matching titles.

Describe alternatives you've considered An implementation using title matching has been provided in #1092.

Additional context

  • Discussion: https://github.com/ipfs/ipfs-companion/pull/1092#pullrequestreview-1101156516
  • Follow Up to: https://github.com/ipfs/ipfs-companion/issues/1010
  • Initial PR: https://github.com/ipfs/ipfs-companion/pull/1092

Additional tasks

  • [ ] add tests for local subdomain gateway: .ipns.localhost:8080 and for .ipfs.localhost:8080

whizzzkid avatar Sep 11 '22 22:09 whizzzkid

@lidel can you please assign this to me?

whizzzkid avatar Sep 11 '22 22:09 whizzzkid