lbry-desktop/web
infinite-persistence 9b44b7eb91 Add a timeout on SDK calls to allow specific error messages.
## Issue 1263
Previously, we tried to inform the user that when an SDK call such as `support_create` and `publish` fails (specifically, timed out), the operation could be successful -- please check the transactions later.

However, we only covered the case of `fetch` actually getting a response that indicated a timeout, e.g. "status = 524". For our SDK case, the timeout scenario is an error that goes into the `catch` block. In the `catch` block, we can't differentiate whether it is a timeout because it only returns a generic "failed to fetch" message.

## New Approach
Since `fetch` does not support a timeout value, the usual solution is to wrap it with a `setTimeout`. This already exists in our code as `fetchWithTimeout` (yay).

By setting a timeout that is lower than the browser's default and also lower than the SDK operation (90s for most commands, 5m for `publish`), we would now have a way to detect a timeout and inform the user.

Firefox's 90s seems to be the lowest common denominator ... so 60s was chosen as the default (added some buffer).

For the case of 'publish', it is actually called in the backend, so wrap the xhr call with a timeout as well.
2022-05-04 08:10:17 -04:00
..
component Update app to use v2 homepage api 2022-04-15 09:25:08 -04:00
effects [oEmbed] some changes and fixes (#392) 2021-12-01 10:36:52 -05:00
middleware Fix logic 2022-03-03 10:23:40 -05:00
page Odysee updates 2022-04-14 20:31:16 -04:00
setup Add a timeout on SDK calls to allow specific error messages. 2022-05-04 08:10:17 -04:00
src Fix tempFileMiddleware that was serving a cached .well-known file 2022-04-28 09:09:30 -04:00
static/pwa Update PWA manifest 2022-04-05 19:14:58 +02:00
stubs rename lbrytv to web 2020-05-25 17:21:02 -04:00
bundle-id.js fix uuid import with new version 2020-10-02 14:36:22 -04:00
index.js MAKE ODYSEE EVEN MORE BEAUTIFUL (#539) 2022-02-11 13:50:55 -05:00
lbry.js Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
package.json More cleanup 2022-01-31 11:39:03 -05:00
webpack.config.js i18n: restore ability to retrieve new i18n strings 2022-01-03 10:36:12 +08:00
webpack.sw.config.js Browser push notifications (#133) 2021-10-27 10:38:10 -04:00
yarn.lock Bump async from 2.6.3 to 2.6.4 in /web 2022-04-18 06:16:27 -04:00