Skip to content

Bug 2034845 - Fix broken Access Connector on policy modification#809

Open
jporter-dev wants to merge 7 commits into
mozilla:enterprise-mainfrom
jporter-dev:enterprise-bug2034845-access-connector-live-policy-modification
Open

Bug 2034845 - Fix broken Access Connector on policy modification#809
jporter-dev wants to merge 7 commits into
mozilla:enterprise-mainfrom
jporter-dev:enterprise-bug2034845-access-connector-live-policy-modification

Conversation

@jporter-dev
Copy link
Copy Markdown
Contributor

@jporter-dev jporter-dev commented Apr 28, 2026

Description

This PR fixes an issue that occurs when the AccessConnector policy is modified in-place (not added/removed). This results in a broken access connector due to the #inclusionList not being updated when MatchPatterns changes, and the connection not being re-initialized with the new server when the serverlist changes (host/port in policy)

Bugzilla: Bug-2034845

  • IPProtectionServerlist.sys.mjs: fix PrefServerList pref observer registration (was referencing instance instead of class), skip in maybeFetchList() when pref value is unchanged
  • IPPChannelFilter.sys.mjs: register/unregister pref observer to refresh #inclusionSet when changed
  • IPPProxyManager.sys.mjs: add reconnect method for reconnecting to the recommended server from the updated list
  • IPPAutoStart.sys.mjs: add logic to #handleListChanged to reconnect on live changes

Dependencies / Related Issues


Testing

  • Manual testing performed

Steps to verify changes:

  1. Enable AccessConnector policy
  2. Launch browser and navigate to a matching URL
  3. Observe active AccessConnector state
  4. Remove or change matching URL from MatchPatterns
    • This updates the icon live without requiring new navigation or refresh
  5. Observe inactive AccessConnector state
  6. Repeat above for host or port
    • Serverlist changes require new navigation to update
    • Previously new navigation used the old server
    • Changing to an invalid port will result in broken proxy, changing back should fix it

Expected result:

AccessConnector shows active/inactive properly when modifying policy

@jporter-dev jporter-dev self-assigned this Apr 28, 2026
@jporter-dev jporter-dev added bug Something isn't working branch:main PR that should be merged on enterprise-main branch labels Apr 28, 2026
@jporter-dev jporter-dev force-pushed the enterprise-bug2034845-access-connector-live-policy-modification branch 4 times, most recently from 94a8a20 to 47d71ac Compare April 29, 2026 22:15
@jporter-dev jporter-dev marked this pull request as ready for review April 30, 2026 12:51
@jporter-dev jporter-dev force-pushed the enterprise-bug2034845-access-connector-live-policy-modification branch from 47d71ac to 8436997 Compare April 30, 2026 13:05
@lissyx lissyx self-requested a review May 4, 2026 13:41
@lissyx
Copy link
Copy Markdown
Contributor

lissyx commented May 5, 2026

@jporter-dev Now that we have #825 there is no reason not to rebase and add proper testing to ensure this does not regress

Comment thread toolkit/components/ipprotection/IPPAutoStart.sys.mjs Outdated
Comment on lines +61 to +82
if (this.autoStart) {
const state = lazy.IPPProxyManager.state;
if (state === lazy.IPPProxyStates.ACTIVE) {
lazy.IPPProxyManager.switch();
return;
}
if (state === lazy.IPPProxyStates.ERROR) {
await lazy.IPPProxyManager.reset();
lazy.IPPProxyManager.start(
false,
PrivateBrowsingUtils.permanentPrivateBrowsing
);
return;
}
if (state === lazy.IPPProxyStates.READY) {
lazy.IPPProxyManager.start(
false,
PrivateBrowsingUtils.permanentPrivateBrowsing
);
return;
}
}
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.

Is this really the right place? Can we get feedback from people working on IPProtection for this?

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've pinged @strseb for some feedback

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.

The autostart component's job is to "connect once when ready, asap".

So the way i'd read that code is, if autostart is enabled and something changes force-start no matter the current state.
If that always-on is the desired behavior, i'd probably move this into it's own little helper component. And swap out this helper component with the ipp-always-on in IPProtectionActivator.

Otherwise, given the bug-problem text, it sounds like just applying this while active should be sufficient. In that case ProxyManager should observe the serverlist and call switch() while in active.

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.

@strseb I've extracted the logic into a enterprise/IPPAlwaysOn.sys.mjs component that gets loaded in alongside the other helpers in a similar fashion to your IPPEnterpriseAuthProvider PR.

Let me know what you think! If it's the right approach then I can prepare this for upstream

Comment thread toolkit/components/ipprotection/IPPAutoStart.sys.mjs Outdated
Comment thread toolkit/components/ipprotection/IPPChannelFilter.sys.mjs Outdated
Comment thread toolkit/components/ipprotection/IPProtectionServerlist.sys.mjs
Comment thread toolkit/components/ipprotection/IPProtectionServerlist.sys.mjs Outdated
Comment thread toolkit/components/ipprotection/IPProtectionServerlist.sys.mjs Outdated
Comment thread toolkit/components/ipprotection/IPProtectionServerlist.sys.mjs Outdated
Copy link
Copy Markdown
Contributor

@lissyx lissyx left a comment

Choose a reason for hiding this comment

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

LGTM; please verify with a peer of IPProtection for the #handleListChanged implementation if that is the right place.

@jporter-dev jporter-dev force-pushed the enterprise-bug2034845-access-connector-live-policy-modification branch from 0592a3d to e0c6d9c Compare May 6, 2026 15:23
@jporter-dev jporter-dev force-pushed the enterprise-bug2034845-access-connector-live-policy-modification branch 5 times, most recently from aeae02c to 919b96c Compare May 15, 2026 19:23
@jporter-dev jporter-dev force-pushed the enterprise-bug2034845-access-connector-live-policy-modification branch from 919b96c to 03240f8 Compare May 15, 2026 19:24
@jporter-dev jporter-dev requested a review from strseb May 15, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch:main PR that should be merged on enterprise-main branch bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants