Fix: unexpected behavior when deleting Option A and renaming Option B with Option A's value. (#13204)

resolve #12345
The issue was caused by the delete running after the update, which led
to both the old and new options being deleted when they shared the same
value.

---------

Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
This commit is contained in:
Naifer
2025-07-15 15:06:27 +01:00
committed by GitHub
parent df9d2b57f9
commit 2c7a459634
2 changed files with 12 additions and 8 deletions

View File

@ -139,7 +139,13 @@ export class WorkspaceMigrationEnumService {
}
if (allEnumValues?.includes(value)) {
return value;
const isDestinationOfRename = renamedEnumValues?.some(
(enumVal) => enumVal.to === value,
);
if (!isDestinationOfRename) {
return value;
}
}
if (isDefined(defaultValueFallback)) {