Skip to content

Commit

Permalink
Merge pull request #1335 from umbraco/bugfix/clean-up-if-conditions-c…
Browse files Browse the repository at this point in the history
…hange-while-initiating

Fix: handle conditions changed while processing
  • Loading branch information
iOvergaard authored Mar 1, 2024
2 parents 2c55d98 + 7cd16cb commit 9c68c33
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,8 @@ export abstract class UmbBaseExtensionInitializer<
const newPermission = await this._conditionsAreGood();
// Only set new permission if we are still positive, otherwise it means that we have been destroyed in the mean time.
if (newPermission === false || this._isConditionsPositive === false) {
console.warn(
'If this happens then please inform Niels Lyngsø on CMS Team. We are still investigating wether this is a situation we should handle. Ref. No.: 1.',
);
// Then we need to revert the above work:
this._conditionsAreBad();
return;
}
// We update the oldValue as this point, cause in this way we are sure its the value at this point, when doing async code someone else might have changed the state in the mean time.
Expand All @@ -259,9 +258,6 @@ export abstract class UmbBaseExtensionInitializer<

// Only continue if we are still negative, otherwise it means that something changed in the mean time.
if (this._isConditionsPositive === true) {
console.warn(
'If this happens then please inform Niels Lyngsø on CMS Team. We are still investigating wether this is a situation we should handle. Ref. No.: 2.',
);
return;
}
// We update the oldValue as this point, cause in this way we are sure its the value at this point, when doing async code someone else might have changed the state in the mean time.
Expand Down

0 comments on commit 9c68c33

Please sign in to comment.