Skip to content

Bug 2015833 - Fetch policies during engine initialization#459

Merged
gcp merged 4 commits intomozilla:enterprise-mainfrom
1rneh:bug-2015833-fetch-policies-on-engine-initialization
Feb 20, 2026
Merged

Bug 2015833 - Fetch policies during engine initialization#459
gcp merged 4 commits intomozilla:enterprise-mainfrom
1rneh:bug-2015833-fetch-policies-on-engine-initialization

Conversation

@1rneh
Copy link
Contributor

@1rneh 1rneh commented Feb 19, 2026

No description provided.

@1rneh 1rneh requested review from a team and Mossop February 19, 2026 14:33
@1rneh 1rneh force-pushed the bug-2015833-fetch-policies-on-engine-initialization branch from b873762 to 01c3d4b Compare February 19, 2026 15:19
}

const res = await lazy.ConsoleClient.getRemotePolicies();
if (!res.policies) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The previous can throw I think, so you want to catch too, not just nullcheck.

);
this._failed = true;
} else {
this._policies = res.policies;
Copy link
Contributor

@gcp gcp Feb 20, 2026

Choose a reason for hiding this comment

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

Doesn't this need to do a call/trigger/notify to explicitly process the policies?

Copy link
Contributor

@gcp gcp Feb 20, 2026

Choose a reason for hiding this comment

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

_ingestPolicies() or triggerOnPoliciesChanges() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, yes. Good catch! I have to fetch the policies before calling

Let me verify, that that is correct and working.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Verified!

Copy link
Contributor

@jonathanmendez jonathanmendez left a comment

Choose a reason for hiding this comment

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

I agree with gcp's feedback but I'll let him handle the followup. Otherwise looks good.


case "policies-startup": {
const initializedPromise = this._initialize();
this.spinResolve(initializedPromise);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming/guessing that the reason this uses a spinResolve instead of await is that observe is non-async and defined in niIObserver so you can't change that, combined with needing _initialize to finish before calling _runPoliciesCallbacks. Is it worth adding a small comment here explaining the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment added.

Copy link
Contributor

Choose a reason for hiding this comment

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

Some background is probably in the original PR #321 (comment)

@1rneh 1rneh requested a review from gcp February 20, 2026 18:33
@gcp gcp merged commit f90058d into mozilla:enterprise-main Feb 20, 2026
16 checks passed
@1rneh 1rneh deleted the bug-2015833-fetch-policies-on-engine-initialization branch February 25, 2026 11:30
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.

4 participants