lbry-desktop/ui
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 Membership-name state updates 2022-05-04 10:45:58 +08:00
constants Add a timeout on SDK calls to allow specific error messages. 2022-05-04 08:10:17 -04:00
contexts Category: Hide "Repost" from ContentType filter, except for WildWest 2022-04-25 08:49:46 -04:00
effects Generalize useGetLastVisibleSlot 2022-04-18 19:06:02 +08:00
modal Fix crashing when uri has spaces 2022-05-02 09:39:01 -04:00
page Membership-name state updates 2022-05-04 10:45:58 +08:00
redux Membership-name state updates 2022-05-04 10:45:58 +08:00
scss Add sync yt button on channels page 2022-05-03 11:00:06 -04:00
util Add a timeout on SDK calls to allow specific error messages. 2022-05-04 08:10:17 -04:00
analytics.js Thumbnail improvements 2022-03-21 13:13:25 -04:00
app.js
comments.js Remove custom comments server 2022-02-03 10:24:58 -05:00
i18n.js Add env to auto report new strings in console 2022-01-05 00:26:31 -08:00
index.jsx Consolidate legal/requirements fetch 2022-03-17 10:25:59 -04:00
lbry.js Add a timeout on SDK calls to allow specific error messages. 2022-05-04 08:10:17 -04:00
logWarningConsoleMessage.js
native.js
reducers.js Support resume-able upload via tus (#186) 2021-11-10 13:16:16 -05:00
rewards.js Change logic for daily reward claiming to weekly 2021-12-23 02:40:58 -05:00
store.js Patch to restore position upon returning to video until more fully fleshed out fix can be introduced (#817) 2022-02-07 12:51:26 -05:00