image-sequencer icon indicating copy to clipboard operation
image-sequencer copied to clipboard

Offline cache issues (Remaining: display checksum of latest commit + date of last update)

Open jywarren opened this issue 6 years ago • 11 comments

Just reporting a few issues with the offline cache function, maybe related to #544.

Noting our main issues: we don't have an easy way to:

  1. tell if it's being used
  2. when it was updated
  3. what version we're using in the demo

We can break out solutions and sub-issues from here. Just want to say the offline cache is AMAZING and has saved me a number of times when demonstrating this to people. Just looking to expand and refine it. Thank you!!!

  • [x] can we display the package.json version on the page to show what version we are at?
  • [ ] can we also display the checksum of the latest commit?
  • [ ] can we show the date of last update?
  • [x] the cache version numbering (v3) hasn't changed in a long time. Do we have to manually update this in examples/sw.js? (I tried but to no effect)
  • [x] maybe we need it to say something a little more specific, like, A new version is available. Click to update.
  • [x] neither button seems to update the cache
  • [x] we should document how this works somewhere so we can maintain it
  • [x] as in below image, i see 2 links to clear cache
  • ~~can we isolate all the cache-related code as much as possible into /examples/lib/cache/...?~~ (Not possible because of scopes -- @HarshKhandeparkar )

image

Sent from my OnePlus3 using FastHub

jywarren avatar Jan 04 '19 19:01 jywarren

GitMate.io thinks possibly related issues are https://github.com/publiclab/image-sequencer/issues/118 (Assorted improvements to be broken into separate issues), https://github.com/publiclab/image-sequencer/issues/544 (Clear offline cache link not working properly.), https://github.com/publiclab/image-sequencer/issues/48 (A Semantic Issue), https://github.com/publiclab/image-sequencer/issues/227 (PLANNING ISSUE), and https://github.com/publiclab/image-sequencer/issues/388 (Creating a new issue template).

gitmate[bot] avatar Jan 04 '19 19:01 gitmate[bot]

GitMate.io thinks possibly related issues are https://github.com/publiclab/image-sequencer/issues/118 (Assorted improvements to be broken into separate issues), https://github.com/publiclab/image-sequencer/issues/544 (Clear offline cache link not working properly.), https://github.com/publiclab/image-sequencer/issues/48 (A Semantic Issue), https://github.com/publiclab/image-sequencer/issues/227 (PLANNING ISSUE), and https://github.com/publiclab/image-sequencer/issues/388 (Creating a new issue template).

gitmate[bot] avatar Jan 04 '19 19:01 gitmate[bot]

@jywarren the cache seems to be updating, please see the below gif,

cache

To change the cache version number we have to change it manually in sw.js file and then it will get update when we go to the website next time, it does not updates on reload. Please see the gif below :

cache2

We can tie the npm version to the cache version, if we can get the value of npm version in sw.js. Do we manually update the value of npm version?

I like the idea to isolate the cache code and would love to work on it! I will remove the other cache button, as it has no use. I would like to document the working as well. Thanks!

Mridul97 avatar Jan 05 '19 09:01 Mridul97

Yes, that's exactly what I noticed too, the cache works fine for me.

vibhorgupta-gh avatar Jan 05 '19 09:01 vibhorgupta-gh

Some issues are fixed and docs part is mentioned in another issue #761.

harshkhandeparkar avatar Mar 17 '19 19:03 harshkhandeparkar

Hi all, regarding cache, we don't have an easy way to tell if it's being used, when it was updated, or what version we're using in the demo. I think we should consider turning caching off until we can address these as they may be preventing us from diagnosing and detecting these kinds of issues:

https://github.com/publiclab/image-sequencer/issues/1061

jywarren avatar May 25 '19 15:05 jywarren

I've updated the issue above to highlight our main problems and added a few more steps that could be broken out.

jywarren avatar May 25 '19 15:05 jywarren

@jywarren I think we can do something in the long term to improve the service worker, we can build it dynamically using maybe browserify or something. We can keep the code separately and maybe make a grunt task to compile it.

harshkhandeparkar avatar May 25 '19 15:05 harshkhandeparkar

Some parts were completed in #1364

harshkhandeparkar avatar Jan 17 '20 19:01 harshkhandeparkar

Updated to show 2 remaining pieces - the checksum of the last commit and the date of last update. Thanks!

jywarren avatar Nov 17 '20 22:11 jywarren

Confirming this worked (except 2 remaining pieces) for v3.7.1:

Screen Shot 2022-01-15 at 2 25 29 PM Screen Shot 2022-01-15 at 2 25 39 PM

Screen Shot 2022-01-15 at 2 25 42 PM

jywarren avatar Jan 15 '22 19:01 jywarren