Skip to content

fix(android): separate local storage between WebView processes#106

Open
ItsChaceD wants to merge 8 commits intomainfrom
fix/RMET-4918/isolate-local-storage
Open

fix(android): separate local storage between WebView processes#106
ItsChaceD wants to merge 8 commits intomainfrom
fix/RMET-4918/isolate-local-storage

Conversation

@ItsChaceD
Copy link
Copy Markdown
Contributor

@ItsChaceD ItsChaceD commented Jan 19, 2026

This PR updates the Android library to 2.0.0 and documents the relevant fix for isolating localStorage on 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.

@ItsChaceD ItsChaceD requested a review from a team January 19, 2026 21:10
andredestro
andredestro previously approved these changes Apr 6, 2026
Comment thread android/src/main/java/com/capacitorjs/osinappbrowser/InAppBrowserPlugin.kt Outdated
Comment thread CHANGELOG.md
Comment thread package.json Outdated
Comment thread android/src/main/java/com/capacitorjs/osinappbrowser/InAppBrowserPlugin.kt Outdated
Comment thread src/definitions.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@OS-pedrogustavobilro OS-pedrogustavobilro self-assigned this Apr 21, 2026
@ItsChaceD ItsChaceD changed the title fix(android): separate local storage between WebView processes fix(android)!: separate local storage between WebView processes Apr 21, 2026
@ItsChaceD ItsChaceD changed the title fix(android)!: separate local storage between WebView processes fix(android): separate local storage between WebView processes Apr 21, 2026
Comment thread README.md
Comment on lines +37 to +41
> [!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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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