Route moderation cursor and receipts through typed operations

This commit is contained in:
Meta Vens 2026-05-16 12:14:40 +01:00
commit 82f35b22a0
7 changed files with 76 additions and 223 deletions

View file

@ -204,6 +204,10 @@ function applyLegacyCompatibilityOperation(
}
case "record_delivery_receipt":
upsertLegacyRuntimeArray(runtime, "recent_delivery_receipts", operation.receipt, "receiptKey");
runtime.recent_delivery_receipts = readObjectArray(runtime.recent_delivery_receipts)
.filter((entry) => readString(entry, "sentAt"))
.sort((left, right) => (readString(left, "sentAt") ?? "").localeCompare(readString(right, "sentAt") ?? ""))
.slice(-24);
closeLegacyOpenCaseForReceipt(runtime, operation.receipt);
return true;
case "queue_candidate_intervention":