Enterprise app loads old www folder contents until app is restarted


I have an Enterprise app. It detects if an update is available by checking a remote server. A link to the plist is then linked to, and the new IPA is downloaded.

On ios - multiple devices - when I open the app after the updated IPA has reinstalled - the old www files are loaded. If I close the app then open it again, the updated version is as normal. This is very bizarre, but if the app isn’t force closed by the user before it is reopened after the update has reinstalled, the old files still somehow exist. Also, the app uses 3D quick actions. These are working while the app still has the old files.

Has anyone come across this issue and if so, how did you resolve?

Here is my ionic info:

@ionic/cli-utils  : 1.10.2
ionic (Ionic CLI) : 3.10.3

global packages:

Cordova CLI : 7.0.1 

local packages:

@ionic/app-scripts : 2.1.4
Cordova Platforms  : android 6.2.3 ios 4.4.0
Ionic Framework    : ionic-angular 3.6.0


Android SDK Tools : 26.0.2
ios-deploy        : 1.9.1 
ios-sim           : 6.0.0 
Node              : v8.1.4
npm               : 5.1.0 
OS                : macOS Sierra
Xcode             : Xcode 8.3.3 Build version 8E3004b

Just a few days ago someone else posted something similar here in the forum - we couldn’t really resolve it and unfortunately I don’t have the link handy any more. You might want to search a bit, maybe you can find it.

Theoretically this shouldn’t even be possible as the files in www get overwritten on app update. I have no idea what could cause this. Maybe some kind of cache?

Do you output the app version in your app somehow via a native plugin? Does this show the new version while still showing the old content?

I have searched but it’s such an odd situation that I am not sure what words to use to search for this…(bundle, www folder, original files, old files, cached files etc) But yes, the app does check it’s version. Original version is 1.0.0. I install 1.0.1 over original - open app - version number is 1.0.1 but all the files are from 1.0.0. Restart app and the 1.0.1 files are there.

This app has been in development for months - through probably 15 different .ipa updates this has never happened. Now that it’s live it’s suddenly a problem.

I think maybe if the app is left in the background during update then when you relaunch it the old app is somehow still remaining in the background. I did try to close the app and then download and install new update and the problem didn’t occur.

Also - platform.exitApp() - This method is undocumented and seems to do nothing. Has this changed recently? When the app sees an update, it redirects to the .plist file on remote server and then should immediately close. However looking at the exitApp method I don’t think this does anything on ios - at least in Ionic 3.x.x…

Found the topic: Appstore does not update app correctly

I don’t think you can really close an app in iOS.
You can crash it though, HockeyApp for example has a forceCrash method you can call.

So I have continued testing this today.

Closing the app and manually loading the .plist link and installing the new version still has this problem. On first launch of the freshly installed app, the old www folder files are loaded. App Version plugin is showing new version however. If I close the app and reopen, they new files are displayed and everything is fine.

This is happening on 4 different ios devices - all running ios 10.3.3. I can only assume that the webview used is loading cached files - which seems lke a bug that should have been squashed years ago.

I am about to try this with a fresh Ionic app and see if I have the same problem…

Update: This seems to be a problem with Ionic Deploy.

Steps to reproduce:

One - install .ipa
Two - push update via Ionic Deploy
Three - download deploy update to app
Four - update app .ipa
Five - launch app and it loads the previously deployed snapshot, not the new .ipa content as expected
Six - restart app and it does not load the previous deploy - it loads .ipa content as expected (ignores any previous deploy snapshots)

Also, if we don’t download any snapshots, the new .ipa installs and loads correctly. The problem only happens when we download a snapshot then update the .ipa.

Hi, any updates on this? I am having the same issue right now. both android and ios and it is already publish from their store.