Handle stale/missing chunks #6411

Merged
infinite-persistence merged 3 commits from ip/handle.stale.chunk into master 2021-07-08 09:07:09 +02:00
infinite-persistence commented 2021-07-07 09:54:36 +02:00 (Migrated from github.com)

@jessopb, if the solution is acceptable, I'll rework the entire to repo to change from React.lazy to lazyImport
Currently, I only applied it to Settings and TipModal to test the concept.

Solutions that I know of:

  1. Reload on behalf of user (this PR).
  2. Similar to 1, but instead of reloading directly, we display a message somewhere saying "A new version is available. Please refresh".
  3. Run a serviceWorker to listen for changes, and somehow update the current page (this is beyond my understanding to implement at the moment).

It seems like either approach would require a reload, so number 1 seems the easiest.

There are a few caveats, though:

  1. It works seamlessly for Pages (other than the user seeing a brief flash from the reload), but it's a bit odd for smaller lazy-loaded components like the Tip Modal -- it doesn't open the modal after the reload.
  2. Reloading directly can result in data-loss if the user in the middle of something.
@jessopb, if the solution is acceptable, I'll rework the entire to repo to change from `React.lazy` to `lazyImport` Currently, I only applied it to `Settings` and `TipModal` to test the concept. Solutions that I know of: 1. Reload on behalf of user (this PR). 2. Similar to 1, but instead of reloading directly, we display a message somewhere saying "A new version is available. Please refresh". 3. Run a `serviceWorker` to listen for changes, and somehow update the current page (this is beyond my understanding to implement at the moment). It seems like either approach would require a reload, so number 1 seems the easiest. There are a few caveats, though: 1. It works seamlessly for Pages (other than the user seeing a brief flash from the reload), but it's a bit odd for smaller lazy-loaded components like the Tip Modal -- it doesn't open the modal after the reload. 2. Reloading directly can result in data-loss if the user in the middle of something.
jessopb (Migrated from github.com) reviewed 2021-07-07 09:54:36 +02:00
jessopb commented 2021-07-07 14:40:05 +02:00 (Migrated from github.com)

I think this path sounds good.

I think this path sounds good.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#6411
No description provided.