Giter VIP home page Giter VIP logo

Comments (2)

markmarijnissen avatar markmarijnissen commented on May 22, 2024

Hi @rajatrocks ,

It's very easy: The Remote Server is your Single Source of Truth.

Also: App-Loader tries to be efficient and minimize downloads. Using the version in Manifest.json, App-Loader compares the files:

  • Only changed files are downloaded.
  • Try to copy file from bundle first.

How you handle your check -> update -> download logic is up to you.

Let's examine your situation step by step:

  1. You download the App. (version 1)
  2. You do a remote update (version 2)
  3. Your app does a check -> update -> download.
  4. Your app is version 2.
  5. You publish a new version to the App Store (version 3) and to your remote server.
  6. Before your App can check the remote server, the App is updated from the App Store.
  7. Your app still runs version 2 (from the cache) - but it has version 3 files bundled.
  8. Your app does a check -> update -> download. It detects remote version 3. Instead of downloading the files from Remote, it can copy the files from the Bundle.
  9. Your App is now version 3.

What happens if at step 6, your App first checks remote server before downloading App Store update?

  1. Your app does a check -> update -> download - files cannot be copied, so they are downloaded.
  2. Your app is version 3.
  3. Your app is updated from App Store (version 3). This does not change anything - your app was already running version 3 from the cache.

And for fun: What happens if you push a corrupt update?

  1. You do a remote update (version 4).
  2. The app does a check -> update -> download.
  3. The update is corrupt, BOOTSTRAP_OK is not fired b/c of a syntax error. App reverts back to bundled version (3).
  4. App is now version 3 (running form the bundle instead of cache).
  5. The app does a check -- it detects you downloaded this earlier, so it will not update.
  6. You do a remote update (version 5) with a bugfix (no more corrupt).
  7. The app wil update again.

Thanks to the App Store update, the App will fall back on version 3 instead of version 1!

from cordova-app-loader.

rajatrocks avatar rajatrocks commented on May 22, 2024

Great explanation, thank you @markmarijnissen !

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.