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

regression: Use this.getLicense to instead of this._license when calculating shouldPreventAction map #31008

Merged
merged 8 commits into from
Nov 24, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ee/packages/license/src/license.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export class LicenseManager extends Emitter<LicenseEvents> {

private invalidateLicense(): void {
this._valid = false;
this.states.clear();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ggazzo shouldn't the call on "clearLicenseData" do the same?

licenseInvalidated.call(this);
invalidateAll.call(this);
}
Expand Down Expand Up @@ -327,6 +328,8 @@ export class LicenseManager extends Emitter<LicenseEvents> {
'monthlyActiveContacts',
];

const license = this.getLicense();

const items = await Promise.all(
keys.map(async (limit) => {
const cached = this.shouldPreventActionResults.get(limit as LicenseLimitKind);
Expand All @@ -335,9 +338,9 @@ export class LicenseManager extends Emitter<LicenseEvents> {
return [limit as LicenseLimitKind, cached];
}

const fresh = this._license
const fresh = license
? isBehaviorsInResult(
await validateLicenseLimits.call(this, this._license, {
await validateLicenseLimits.call(this, license, {
behaviors: ['prevent_action'],
limits: [limit],
}),
Expand Down
Loading