fix: recover committed dynamic transport errors

This commit is contained in:
Jesse_Chen
2026-07-19 09:24:23 +08:00
parent e90f77bac1
commit 5c5b60b3e4
3 changed files with 75 additions and 4 deletions
@@ -144,7 +144,7 @@ export function createDynamicTurnPersistence(
});
if (result.error) {
const current = await loadCase(value.userId, value.id);
if (isStaleRpc(result.error) && current?.journeyProtocol === "dynamic-choice-v2"
if (current?.journeyProtocol === "dynamic-choice-v2"
&& current.processedActionIds.includes(receipt)) {
if (samePersistedDynamicReceipt(value, current, receipt, expectedVersion)) return current;
throw new StaleJourneyTurnError(value.id, expectedVersion, current.turnVersion);