fix(system): keep the server's search-again line on a duplicate review

A duplicate cleanup review the server refuses with 409 sources-changed
showed the generic "could not be reviewed" message; it now shows the
server's "The sources changed since the search. Search for duplicates
again."
This commit is contained in:
Vito Sansevero
2026-10-25 05:04:38 -07:00
parent 1b9c6ce13c
commit f3a2912aa1
2 changed files with 4 additions and 1 deletions
@@ -93,6 +93,9 @@ test('a refused apply names its reason; a lost answer is not confirmed', async (
assert.equal(reviewRefusal(error(413, 'too-large', 'This plan is too large to review at once.')),
'This plan is too large to review at once.');
assert.equal(reviewRefusal(error(500, null, 'boom')), REVIEW_FAILED);
// S7 re-review N1: a duplicate review whose sources changed since the search keeps the server's "search again".
const changed = 'The sources changed since the search. Search for duplicates again.';
assert.equal(reviewRefusal(error(409, 'sources-changed', changed)), changed);
assert.equal(reviewRefusal(new TypeError('x')), REVIEW_FAILED);
});
+1 -1
View File
@@ -56,7 +56,7 @@ export const OPERATION_TITLES = Object.freeze({
const REVIEW_AGAIN = new Set(['plan-expired', 'storage-changed']);
// Refusals whose server message is the whole truth.
const SERVER_SAYS = new Set(['insufficient-space', 'nothing-to-do', 'too-large', 'invalid-request', 'not-found',
'job-running', 'no-groups', 'apply-failed']);
'job-running', 'no-groups', 'apply-failed', 'sources-changed']);
const number = value => value.toLocaleString('en-US');