9b44b7eb91
## 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. |
||
---|---|---|
.. | ||
component | ||
effects | ||
middleware | ||
page | ||
setup | ||
src | ||
static/pwa | ||
stubs | ||
bundle-id.js | ||
index.js | ||
lbry.js | ||
package.json | ||
webpack.config.js | ||
webpack.sw.config.js | ||
yarn.lock |