fix: complete October 22 workflow feedback and request failure recovery

This commit is contained in:
2026-10-22 23:06:04 +08:00
parent 5fcc51d73c
commit 51109ac852
13 changed files with 161 additions and 230 deletions
+4 -6
View File
@@ -63,7 +63,7 @@ test('query failure is not retried as a completion mutation and completed accept
readTask: async () => assert.fail('no query after authoritative completion'), isActive: () => true, onTask() {} }), completed)
})
test('page only announces success and clears the original attempt after authoritative completion', async () => {
test('page only announces success without persisting a replay request after authoritative completion', async () => {
const page = await readFile(new URL('../pages/picking/picking.vue', import.meta.url), 'utf8')
const method = page.match(/async completeLoadingTask\(\) \{[\s\S]*?\n\t\t\t\},/)?.[0]
assert.ok(method)
@@ -96,10 +96,8 @@ test('page only announces success and clears the original attempt after authorit
}
await behavior.completeLoadingTask.call(context)
assert.equal(context.submitting, false)
assert.equal(saved.length, 1)
assert.equal(saved[0].operationId, 'original-operation')
assert.equal(saved[0].expectedTaskVersion, 1)
assert.equal(cleared.length, status === 'COMPLETED' ? 1 : 0)
assert.equal(saved.length, 0)
assert.equal(cleared.length, 0)
assert.equal(messages.some(message => message.message === '装柜已完成'), status === 'COMPLETED')
if (status !== 'COMPLETED') assert.ok(context.remoteError)
}
@@ -127,7 +125,7 @@ test('reopened processing and completed tasks keep evidence and completion read-
assert.equal(behavior.evidenceReadOnly.call(retry), false)
assert.match(page, /v-if="evidenceReadOnly"[^>]*role="status"/)
assert.match(page, /v-else class="loading-complete-btn"/)
assert.match(page, /class="evidence-btn evidence-add-btn" :disabled="evidenceReadOnly"/)
assert.match(page, /class="evidence-btn evidence-add-btn" :disabled="evidenceReadOnly \|\| evidenceUploading"/)
})
test('accepted completion is processing and blocks every repeated mutation', () => {