Giter VIP home page Giter VIP logo

Comments (2)

markmarijnissen avatar markmarijnissen commented on May 16, 2024

Interesting.

First thought: I expect check() to resolve when it successfully downloads the manifest.

Second thought: It makes sense to reject the manifest in order to tell the outside world: Please re-check the manifest (until it is a new manifest it can try).

Third thought: Re-checking the manifest (outside of the normal schedule) will not help resolve this problem.

The deeper problem is - there are many results of an check():

  • Valid response:
    • true: There is a new Manifest available
    • false: There is no new Manifest available.
    • null: There is a new manifest available, but a previous update attempt failed.
  • Error conditions:
    • XHR failed for server Manifest (i.e. internet connnection problem)
    • XHR failed for bundled Manifest
    • Cache failed to list files (filesystem errors)
    • Manifest is missing files attribute.

My current logic is:

  • on reject(), you should check() again.
  • on resolve(), you should deal with the results.
    • when true, you may download and update
    • when false, you can schedule another check later (or do nothing)
    • when null, you can schedule another check later (perhaps a bit faster), or you could reinstall the entire app (i.e. clear cache).

By the way, as a hack, you could clear last_update_files from localStorage after calling download() to ignore this protective measure. I could also make this an option.

from cordova-app-loader.

arieljake avatar arieljake commented on May 16, 2024

Totally understand your thinking. Sounds good.

from cordova-app-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.