Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Update doesn't reload changed files correctly #2

Closed
pablomaurer opened this issue Sep 21, 2015 · 7 comments
Closed

Update doesn't reload changed files correctly #2

pablomaurer opened this issue Sep 21, 2015 · 7 comments
Assignees
Labels
Milestone

Comments

@pablomaurer
Copy link
Contributor

Hi, everything seems to work fine. It finds the changed files, downloads it. I also can see, how the app get's reloaded, but the css changes doesn't appear.

I use Ionic and did follow the ionic guide in your readme. Because I have almost no idea about Objective-c and xCode i also don't have an idea on how to debug this thing.

I forked your project and added a folder example/ionic which you maybe can test, if you don't already have one seted up.

In this example i did not build any chcp files.

Can it be that it does save the downloaded files on the wrong location, and because of that it still loads the old style.css file?

@nikDemyankov nikDemyankov self-assigned this Sep 21, 2015
@nikDemyankov
Copy link
Member

Hi. I'll look into your test project, thanks.

Right now I have created empty Ionic project as in documentation, and it worked fine: both css and html files are updated. Later will add it as an example to this repo. But maybe for more complicated examples it doesn't work properly (with side navigation). Will test it.

@pablomaurer pablomaurer changed the title Update doesn't load changed files Update doesn't reload changed files correctly Sep 28, 2015
@pablomaurer
Copy link
Contributor Author

Ok, got it. If i run $window.location.reload(); after the update it works =) yaaay
But your update function also does already something similar like reloading, but that doesn't work..

Now the problem is, that I just can run the function with a button after the update. Because your ÙpdateInstalled event fires directly after the update and not after your reload. So the app gets reloaded before my $window.location.reload(); can run.

@nikDemyankov
Copy link
Member

Hi. Well, your solution can help, but this didn't work for android (in Cordova), because if then you will press on back button - you will return to the old page, which is wrong. So instead, it reloads the page on the native side. Why it doesn't work for you- don't know yet. I'm few days off, will continue with Ionic support on Wednesday. Will see how it will go. But thanks for your tip :)

@nikDemyankov
Copy link
Member

Done some testing, and it seems that this is a caching issue: UIWebView caches css files, and simple refresh doesn't help. If you, for example, force kill the app and launch it - cache is cleaned and everything is fine. Or if you add version number in the css file path like so:

<link href="css/style.css?ver=1" rel="stylesheet">

But those are all hacks. The existing refresh way works, but not always. Found another solution, but need to test it more.

This is an iOS only issue, work's fine on Android.

@nikDemyankov
Copy link
Member

Should be fixed with the next release

@kittugit
Copy link

First of all, thanks for making this plugin..
I got same issue in my ionic project.. Automatic update is not working.. if i open the app, after remove it from background, it shows new changes... it seems, ionic views are cached.. is anyone solved this issue?

@nikDemyankov
Copy link
Member

@kittugit thanks. Did you use version from npm, or from master branch on github? If from npm - then yes, it is a caching problem on iOS. Should be fixed, if you use version from github. Didn't release new stable version yet.

@nikDemyankov nikDemyankov added this to the 1.0.4 milestone Oct 21, 2015
nikDemyankov pushed a commit that referenced this issue Aug 31, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants