Thank you for your response.
I know that migrations for local DB would do the job, but there are
cases when the code/db changes are so big that the converting local
sored code/db to new versions is nearly impossible. This is why I have
implemented on server side code that can handle the old code/data
format and new code/date format.
Solution that I implemented it was to modify the manifest url after
application is in offline state (I know if the application is in on/
off line status even if there is an internet connection available) to
go to an invalid page. This solve the problem because the coed will
not be updated for local apps until they came online, but looks
strange to solve a problem by generating an error. This is why I think
that a new option to the store would be nice. Something like
"readwrite attribute boolean autoUpdateEnabled".
What you think? Is there any chance to such a feature to be
implemented?
Eduard
On Nov 6, 10:11 pm, Michael Nordman <
micha...@google.com> wrote:
> I think your observations about how local databases with a version specific
> structure (distinct from the application code) complicates things is very
> correct.
> One approach taken by some apps has been to have the new application code
> migrate existing local databases to the new schema upon first use. So
> upgrade the local databases after the application code updates.
> There is an indirect means to enable/disable autoupdate. Once a version has
> been successfully downloaded, set the manifestUrl to a url which always
> returns a 304 response, autoupdates will start but quickly find nothing
> todo.
>
> Given that, another approach could be for application code to detect when a
> new version is available thru some other means (like fetch the real
> manifestUrl and compare it's 'version' attribute to store.currentVersion).
> Application code could create and populate a new upgraded database in the
> background, and when ready reset the store's manifestUrl and call
> CheckForUpdate explicitly, and upon update completion reset the manifestUrl
> back to the 304 generator.
>
> I don't think Gears (or HTML5) has a good handle on this aspect of things or
> what the best practices are.
>