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 fix autolaunch after changing linux cmd capitalization 2019-12-17 13:38:09 -05:00
batch-actions.js Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
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 Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
country.js Util to get list of countries 2021-04-21 10:49:31 -04:00
debounce.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
deep-equal.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
default-languages.js Revert "Code-split homepages" 2021-10-28 01:33:46 +08:00
detect-typing.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
detect-user-bandwidth.js Send video bitrate and user bandwidth to Watchman (#7145) 2021-10-06 14:59:33 -04:00
downloadClaim.js Move 'Download' and 'Report Content' into overflow menu. 2021-06-18 15:50:13 -04:00
enhanced-layout.js mobile view 2019-12-20 15:03:18 -05:00
fetch.js add 10 second timeout to lbrytv status call 2020-03-16 17:59:24 -04:00
file.js Support resume-able upload via tus (#186) 2021-11-10 13:16:16 -05:00
form-validation.js Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
format-bytes.js use new buffer analytics api 2020-08-07 22:54:29 -04:00
format-credits.js Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
formatAriaLabel.js fix typo 2021-07-29 11:52:34 -05:00
formatMediaDuration.js add more info for claim-preview-tile aria label 2021-07-15 18:12:11 -05:00
full-screen.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
generate-thumbnail-name.js style pass for channel edit 2020-07-01 22:04:23 -04:00
handle-fetch.js send recsys powered-by (#6875) 2021-08-17 10:03:25 -04:00
hex.js hyperchats 2021-04-23 16:20:17 -04:00
lazyImport.js ChunkLoadError: ask user to reload instead of automatically reloading (#139) 2021-10-27 11:07:06 -04:00
lbryURI.js Add option to hide buildUri warnings 2021-11-03 13:01:13 +08:00
livestream.js Livestream category improvements (#7115) 2021-09-24 10:26:21 -04:00
merge-claim.js Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
number.js show total balance on wallet page/header 2021-01-22 11:46:27 -05:00
object.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
parse-data.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
publish.js wip 2021-06-08 13:25:52 -04:00
query-params.js Recommended changes (#7089) 2021-09-16 16:00:44 -04:00
redux-utils.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
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 [Comment/Livestream] Markdown and style fixes (#55) 2021-10-12 17:06:20 -04:00
saved-passwords.js allow signin on local using non-production SameSite=Lax 2020-07-24 16:48:05 -04:00
search.js Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
set-operations.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
shuffle-array.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
storage.js Upload: tab sync and various fixes (#428) 2021-12-07 09:48:09 -05:00
string.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
stripe.js Chore desktop cleanup (#6896) 2021-08-17 18:34:16 -04:00
swap-json.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
sync-settings.js Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
throttle.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
thumbnail.js use thumbnails.odysee.com 2021-10-07 16:38:59 -04:00
time.js Allow video sharing with start timestamp 2020-05-08 14:00:59 -04:00
transifex-upload.js Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
tus.js Upload: tab sync and various fixes (#428) 2021-12-07 09:48:09 -05:00
url.js Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
web-file-system.js Support drag-and-drop file publishing (#4170) 2020-05-25 10:27:36 -04:00
web.js [oEmbed] some changes and fixes (#392) 2021-12-01 10:36:52 -05:00
zoomWindow.js Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00