lbry-desktop/ui/util
infinite-persistence 157b50c58e
Upload: tab sync and various fixes (#428)
* 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)
2021-12-07 09:48:09 -05:00
..
autoLaunch.js
batch-actions.js
buildHomepage.js Re-enable reposts on homepages (#352) 2021-11-24 11:11:25 -05:00
claim.js Fix inability to unblock an abandoned claim 2021-12-01 21:21:09 +08:00
comments.js Use replace instead of replaceAll for browser compatibility (#222) 2021-11-04 00:56:29 -04:00
context-menu.js
country.js
debounce.js
deep-equal.js
default-languages.js Revert "Code-split homepages" 2021-10-28 01:33:46 +08:00
detect-typing.js
detect-user-bandwidth.js
downloadClaim.js
enhanced-layout.js
fetch.js
file.js Support resume-able upload via tus (#186) 2021-11-10 13:16:16 -05:00
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 Add option to hide buildUri warnings 2021-11-03 13:01:13 +08:00
livestream.js
merge-claim.js
number.js
object.js
parse-data.js
publish.js
query-params.js
redux-utils.js
remark-emote.js Stickers/emojis fall out / improvements (#220) 2021-11-05 15:31:51 -04:00
remark-lbry.js Adjust channel mention regex (#269) 2021-11-10 14:53:42 -05:00
remark-timestamp.js
saved-passwords.js
search.js
set-operations.js
shuffle-array.js
storage.js Upload: tab sync and various fixes (#428) 2021-12-07 09:48:09 -05:00
string.js
stripe.js
swap-json.js
sync-settings.js
throttle.js
thumbnail.js
time.js
transifex-upload.js
tus.js Upload: tab sync and various fixes (#428) 2021-12-07 09:48:09 -05:00
url.js
web-file-system.js
web.js [oEmbed] some changes and fixes (#392) 2021-12-01 10:36:52 -05:00
zoomWindow.js