Comments (2)
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 availablefalse
: 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 shouldcheck()
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).
- when
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.
Totally understand your thinking. Sounds good.
from cordova-app-loader.
Related Issues (20)
- Auto-reset when updating apk HOT 2
- Is it possible to custom remote file url
- problem and suggest HOT 1
- How to deal with fonts
- Calling download() never finishes. HOT 3
- onSingleDownloadProgress is not a function HOT 3
- Error: Not allowed to load local resource
- Remote Updating HTML files? HOT 2
- file is long time cached by server,the file do not affected!
- Getting FileError
- stuck when starting the app
- Multiple servers: one server per each AppStore app version
- Updates not working in combination with cordova-plugin-crypt-file HOT 1
- Still having issues with Phonegap Developer app
- Question: Does this way of auto-updating go against the guidelines of Apple? HOT 3
- Error code 1 when cloning demo - no exception message
- Cordova plugin HOT 1
- download promise is neither getting resolved nor rejected HOT 1
- app.js file inside www is not updated with latest code HOT 4
- This plugin not working in android
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-app-loader.