clean protection for 100%

This commit is contained in:
fyears 2024-03-26 23:39:53 +08:00
parent 833fdee69e
commit bff2f6a642
2 changed files with 10 additions and 4 deletions

View File

@ -888,7 +888,7 @@ const splitThreeStepsOnEntityMappings = (
} }
realTotalCount += 1; realTotalCount += 1;
if (val.decision.startsWith("deleted")) { if (val.decision.includes("deleted")) {
realModifyDeleteCount += 1; realModifyDeleteCount += 1;
} }
} else if ( } else if (
@ -915,8 +915,8 @@ const splitThreeStepsOnEntityMappings = (
realTotalCount += 1; realTotalCount += 1;
if ( if (
val.decision.startsWith("modified") || val.decision.includes("modified") ||
val.decision.startsWith("conflict") val.decision.includes("conflict")
) { ) {
realModifyDeleteCount += 1; realModifyDeleteCount += 1;
} }
@ -1115,6 +1115,12 @@ export const doActualSync = async (
allFilesCount > 0 allFilesCount > 0
) { ) {
if ( if (
protectModifyPercentage === 100 &&
realModifyDeleteCount === allFilesCount
) {
// special treatment for 100%
// let it pass, we do nothing here
} else if (
realModifyDeleteCount * 100 >= realModifyDeleteCount * 100 >=
allFilesCount * protectModifyPercentage allFilesCount * protectModifyPercentage
) { ) {