Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(ios) Added a NSURLRequestReloadIgnoringLocalCacheData policy when lo… #1471

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BBlashko
Copy link

…ading requests

Platforms affected

  • iOS

Motivation and Context

There is a problem with iOS where the diskcache aka .js, html, and css etc files are cached between .ipa installs.

When updating .ipa bundles in the Apple AppStore, it was evident that when using the fileURL system the WKWebView holds onto a previously cached cordova framework files. This can result in a fatal when booting the application if you remove a plugin. If this happens the cordova_plugins.js file doesn't get updated, so it tries to load the deleted plugin. This creates a hard blocking result, since the plugin files don't exist, so cordova cannot load the plugin (even though it should be removed)

There is no issue for this at this time, I was discussing it with Norman Breau in the Slack Space

Description

This is a follow up Pull Request to this request:
#1451

Instead of flushing cache at the boot of the cordova framework. It was suggested to just ignore local cache when loadRequest() is called.

So when cordova runs the loadRequest function in the CDVWebViewEngine.m file, we apply a NSURLRequestReloadIgnoringLocalCacheData cache policy to the request. This should ignore any cached instances and pull the files directly

Testing

Loaded our local dev app with the new policy applied to requests. Inspected the Network of the device to track down if the app is using files from the WKWebView Cache or not.

We also are still getting these errors into our error reporting systems.

Module branch-cordova-sdk.Branch does not exist.

I can validate that these start to stop coming in completely on the new version of our production application.

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)
  • [*] I've updated the documentation if necessary

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.31%. Comparing base (d8ebfb3) to head (a53af63).
Report is 11 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1471      +/-   ##
==========================================
- Coverage   78.35%   78.31%   -0.05%     
==========================================
  Files          16       16              
  Lines        1825     1826       +1     
==========================================
  Hits         1430     1430              
- Misses        395      396       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants