Stabilize repo face heartbeat transport
This commit is contained in:
parent
135f30efac
commit
c93b1d1716
27 changed files with 2108 additions and 253 deletions
|
|
@ -561,6 +561,7 @@ function closeTypedOpenCase(
|
|||
openCase.resolvedAt = operation.resolvedAt;
|
||||
openCase.lastTouchedAt = operation.resolvedAt;
|
||||
openCase.resolutionSummary = operation.resolutionSummary;
|
||||
normalizeAnsweredOpenCaseSummary(openCase);
|
||||
}
|
||||
cursor.updatedAt = operation.resolvedAt;
|
||||
}
|
||||
|
|
@ -588,7 +589,11 @@ function closeCasesForReceipt(
|
|||
}
|
||||
|
||||
for (const openCase of cursor.openCases) {
|
||||
if (openCase.sourceMessageId !== receipt.replyToMessageId || isTerminalCaseStatus(openCase.status)) {
|
||||
if (openCase.sourceMessageId !== receipt.replyToMessageId) {
|
||||
continue;
|
||||
}
|
||||
if (isTerminalCaseStatus(openCase.status)) {
|
||||
normalizeAnsweredOpenCaseSummary(openCase);
|
||||
continue;
|
||||
}
|
||||
openCase.status = "answered";
|
||||
|
|
@ -597,10 +602,23 @@ function closeCasesForReceipt(
|
|||
openCase.resolutionSummary = receipt.preview
|
||||
? `Answered in-channel: ${receipt.preview}`
|
||||
: "Answered in-channel.";
|
||||
normalizeAnsweredOpenCaseSummary(openCase);
|
||||
}
|
||||
cursor.updatedAt = receipt.sentAt;
|
||||
}
|
||||
|
||||
function normalizeAnsweredOpenCaseSummary(
|
||||
openCase: VoidModerationCursor["openCases"][number],
|
||||
): void {
|
||||
if (openCase.status !== "answered") {
|
||||
return;
|
||||
}
|
||||
|
||||
openCase.summary = openCase.summary
|
||||
.replace(/\bVoid has not answered yet\b\.?/i, "Void answered in-channel.")
|
||||
.replace(/\band Void answered in-channel\./i, "and Void answered in-channel.");
|
||||
}
|
||||
|
||||
function retireCandidateIntervention(
|
||||
candidates: VoidCandidateInterventions,
|
||||
operation: Extract<VoidSelfStateOperation, { operation: "retire_candidate_intervention" }>,
|
||||
|
|
|
|||
Loading…
Reference in a new issue