Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Store updates #16

Closed
rajatrocks opened this issue Jan 22, 2015 · 2 comments
Closed

App Store updates #16

rajatrocks opened this issue Jan 22, 2015 · 2 comments

Comments

@rajatrocks
Copy link

Hi @markmarijnissen - great library, and I think I have it all working in my app! I was reading through the various closed issues, and I'm still confused on how App Store updates are handled. If I've downloaded the app and then done one or more remote updates, and then download a new version from the App Store, will it copy over the newly downloaded files into the cache, or will it try to do a remote update, or something else? Any insight would be much appreciated.

best, - rajat

@markmarijnissen
Copy link
Owner

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!

@rajatrocks
Copy link
Author

Great explanation, thank you @markmarijnissen !

markmarijnissen added a commit that referenced this issue Mar 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants