157b50c58e
* Upload: fix redux key clash ## Issue `params` is the "final" value that will be passed to the SDK and `channel` is not a valid argument (it should be `channel_name`). Also, it seems like we only pass the channel ID now and skip the channel name entirely. For the anonymous case, a clash will still happen when since the channel part is hardcoded to `anonymous`. ## Approach Generate a guid in `params` and use that as the key to handle all the cases above. We couldn't use the `uploadUrl` because v1 doesn't have it. The old formula is retained to allow users to retry or cancel their existing uploads one last time (otherwise it will persist forever). The next upload will be using the new key. * Upload: add tab-locking ## Issue - The previous code does detect uploads from multiple tabs, but it was done by handling the CONFLICT error message from the backend. At certain corner-cases, this does not work well. A better way is to not allow resumption while the same file is being uploading from another tab. - When an upload from 1 tab finishes, the GUI on the other tab does not remove the completed item. User either have to refresh or click Cancel. Clicking Cancel results in the 404 backend error. This should be avoided. ## Approach - Added tab synchronization and locking by passing the "locked" and "removed" information through `localStorage`. ## Other considered approaches - Wallet sync -- but decided not to pollute the wallet. - 3rd-party redux tab syncing -- but decided it's not worth adding another module for 1 usage. * Upload: check if locked before confirming delete ## Reproduce Have 2 tabs + paused upload Open "cancel" dialog in one of the tabs. Continue upload in other tab Confirm cancellation in first tab Upload disappears from both tabs, but based on network traffic the upload keeps happening. (If upload finishes the claim seems to get created) |
||
---|---|---|
.. | ||
autoLaunch.js | ||
batch-actions.js | ||
buildHomepage.js | ||
claim.js | ||
comments.js | ||
context-menu.js | ||
country.js | ||
debounce.js | ||
deep-equal.js | ||
default-languages.js | ||
detect-typing.js | ||
detect-user-bandwidth.js | ||
downloadClaim.js | ||
enhanced-layout.js | ||
fetch.js | ||
file.js | ||
form-validation.js | ||
format-bytes.js | ||
format-credits.js | ||
formatAriaLabel.js | ||
formatMediaDuration.js | ||
full-screen.js | ||
generate-thumbnail-name.js | ||
handle-fetch.js | ||
hex.js | ||
lazyImport.js | ||
lbryURI.js | ||
livestream.js | ||
merge-claim.js | ||
number.js | ||
object.js | ||
parse-data.js | ||
publish.js | ||
query-params.js | ||
redux-utils.js | ||
remark-emote.js | ||
remark-lbry.js | ||
remark-timestamp.js | ||
saved-passwords.js | ||
search.js | ||
set-operations.js | ||
shuffle-array.js | ||
storage.js | ||
string.js | ||
stripe.js | ||
swap-json.js | ||
sync-settings.js | ||
throttle.js | ||
thumbnail.js | ||
time.js | ||
transifex-upload.js | ||
tus.js | ||
url.js | ||
web-file-system.js | ||
web.js | ||
zoomWindow.js |