fix(android): separate local storage between WebView processes#106
fix(android): separate local storage between WebView processes#106
Conversation
There was a problem hiding this comment.
Note about marking this as a breaking change / major version in the Capacitor plugin: Either the squash-commit needs to have a BREAKING CHANGE: <describe breaking change> in the commit footer so that semantic-release does the major version bump (should try a dry-run locally on main just to check), or we do a manual release.
Plus (not applicable to this PR specifically) we should create a 3.x branch before this PR is merged, but as for releasing patches in 3.x, I'm not sure how to approach this (2.x is going to latest-7, would 3.x go to latest-8, and where would 4.x go to if we do Capacitor-9 related breaking changes in a 5.x?), because up until now we've had one major version per Capacitor major version, think this will be the first plugin to break this rule. Maybe this needs to be brought up to the team internally, but mentioning it here because I think we haven't had this dicussion.
There was a problem hiding this comment.
I added the exclamation mark just in case, but will also add it to the footer of the squashed commit.
As far as the versioning, you bring up a valid point. I think in this case, we should just create a 3.x branch and merge this there along with any other Capacitor 9 upgrades we will do in the upcoming weeks. This "bug" wasn't reported by any customer / user except internally so I don't believe it is very urgent.
For future breaking changes, it will probably be a case-by-case basis, but if we target only 1 release of a major version per year for Capacitor.. then we will probably eventually run into scenarios where we will have to break the rule, especially if its an urgent bug fix or something
There was a problem hiding this comment.
I added the exclamation mark just in case
Exclamation mark won't work, because semantic-release in this repo is following Angular Commit convention, not conventional commits, where there's no "!"; I'd say probably it's best not to have one.
As far as the versioning, you bring up a valid point. I think in this case, we should just create a 3.x branch and merge this there along with any other Capacitor 9 upgrades we will do in the upcoming weeks. This "bug" wasn't reported by any customer / user except internally so I don't believe it is very urgent.
Not sure I follow. If we want to bring this fix to OutSystems, we need to update the Capacitor plugin and use it on ODC.
There was a problem hiding this comment.
Sorry I meant to advocate for making the 3.x branch, but only merge this change to main. That way it is only included with the next major release which will likely be with the other Capacitor 9 upgrades. I don't think this needs to make it into the current version since it's not as urgent and might be weird for us to be making 2 major releases for a single Capacitor version unless it's necessary, especially since there isn't a precedent and then we'd be releasing another major release right after.
I will bring it up to the team to see their thoughts because I think it is an important discussion
There was a problem hiding this comment.
Per internal discussions we're fine with raising the major version now, just keep in mind the initial comment I made that I think is still relevant regarding how to do the version bump + (and I don't think we discussed this with the team, or maybe we did and I forgot) should we keep maintaining 3.x after releasing 4.x?
| > [!CAUTION] | ||
| > Disabling isolation reduces the security of your app by allowing potentially untrusted web content to access your application's private storage (Cookies, LocalStorage, etc.). Use this only if absolutely necessary. | ||
|
|
||
| > [!WARNING] | ||
| > **Breaking Change (Android)**: Apps upgrading to this version will lose any existing `localStorage` or cookies previously stored by the InAppBrowser on the first run. This is because the WebView now runs in a separate process with its own data directory. Users may need to re-authenticate with websites that relied on persisted session data. |
There was a problem hiding this comment.
Also forgot to write a comment on this. I don't know if this is a standard we already use for other docs, just asking to check how this can look in the capacitor docs website, if it looks nice like in GitHub Markdown or not.
This PR updates the Android library to
2.0.0and documents the relevant fix for isolatinglocalStorageon Android.Context: OutSystems/OSInAppBrowserLib-Android#54
MABS 12 Capacitor (BUILD 3)
Steps to reproduce:
The new page includes the setting for IsIsolated and then a toggle for showing an iframe of a website where you can change some stored values like background color, font type, etc... Then there is a button for going to the same URL on the WebView. If storage is isolated then the values won't persist, but if it's toggled off or you are testing on an older device, then the values will be the same as the iframe.