BBlashko opened a new pull request, #1451:
URL: https://github.com/apache/cordova-ios/pull/1451

   …ion changes
   
   <!--
   Please make sure the checklist boxes are all checked before submitting the 
PR. The checklist is intended as a quick reference, for complete details please 
see our Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
    - ios
   
   
   
   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   <!-- If it fixes an open issue, please link to the issue here. -->
   
   This Pull Request adds a routine to the Boot of cordova-ios so that we can 
flush diskcache in the WkWebView. There is a problem with iOS where the 
diskcache aka .js, html, and css etc files are cached between .ipa installs. 
   
   There is no issue for this at this time, I was discussing it with Norman 
Breau in the Slack Space
   
   ### Description
   <!-- Describe your changes in detail -->
   
   In the AppDelegate.m file I have added a routine to clear the 
`WKWebsiteDataTypeDiskCache` for the domain from the `Bundle ID`, and 
`localhost`. This cache needs to be flushed because it latches on to previous 
`js, html, css, etc` files from a previous `.ipa` installation.  These cached 
files include the `cordova.js` and `cordova_plugins.js` files. I know this 
because I added hacks into these files, but they were not registered on the 
target production application.
   
   The main problem this addresses is removals of Cordova Plugins. Where the 
cached cordova_plugins.js thinks that it needs to load a removed plugin, but 
since the plugins www directory was removed it doesn't exist. 
   
   An example error message is as follows:
   ```
   Module branch-cordova-sdk.Branch does not exist.
   ```
   
   Now I cannot confirm at this time, but it does indicate that with this 
cached files, that any additions to cordova_plugins.js may not be loaded at 
runtime. 
   
   I want to mention that this problem is extremely hard to reproduce in local 
environments. It _needs_ to be on device, and it needs to be an update to an 
already installed application in production. Eg. I have 3.72.0 on my device, a 
new 3.73.0 version is released with removed/updated plugins, then this case 
_can_ happen it is not guaranteed to happen for all users.
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   
   Our QA engineer had an instance of the application stuck in this state. The 
Error: 
   ```
   Module branch-cordova-sdk.Branch does not exist.
   ```
   
   This error was thrown everytime they booted the application, where the UI 
was stuck on the Splashscreen. 
   
   Updating to the latest .ipa (with these changes in the PR) and booting, the 
user was able to get "unstuck".  However, it's not a _perfect_ solution because 
while the cache did get flushed, it didn't immediately repopulate it, and the 
user had to reboot the app. On second boot after this fix was introduced the 
user was able to boot the application successfully.
   
   ### Checklist
   
   - [*] I've run the tests to see all new and existing tests pass
   - [*] I added automated test coverage as appropriate for this change
   - [*] Commit is prefixed with `(platform)` if this change only applies to 
one platform (e.g. `(android)`)
   - [*] If this Pull Request resolves an issue, I linked to the issue in the 
text above (and used the correct [keyword to close issues using 
keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [*] I've updated the documentation if necessary
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to