From 5161670cb8e3f45789ca0c96a680a143e282438c Mon Sep 17 00:00:00 2001 From: undefined Date: Wed, 31 Dec 2025 10:17:41 +0800 Subject: [PATCH] core: judge: ensure judge event key --- packages/hydrooj/src/handler/judge.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/hydrooj/src/handler/judge.ts b/packages/hydrooj/src/handler/judge.ts index 59c5d7b98..cf65c0481 100644 --- a/packages/hydrooj/src/handler/judge.ts +++ b/packages/hydrooj/src/handler/judge.ts @@ -99,6 +99,7 @@ export class JudgeResultCallbackContext { }, { upsert: true }); } else { const rdoc = await record.update(this.task.domainId, new ObjectId(this.task.rid as string), $set, $push, $unset, $inc); + body.key = 'next'; if (rdoc) this.ctx.broadcast('record/change', rdoc, $set, $push, body); } } @@ -107,6 +108,7 @@ export class JudgeResultCallbackContext { const { $set, $push, $unset, $inc, } = processPayload(body); + body.key = 'next'; const rdoc = await record.update(domainId, rid, $set, $push, $unset, $inc); if (rdoc) app.broadcast('record/change', rdoc, $set, $push, body); } @@ -156,6 +158,7 @@ export class JudgeResultCallbackContext { const rdoc = await record.update(this.task.domainId, new ObjectId(this.task.rid as string), $set, $push, $unset); if (rdoc) { + body.key = 'end'; bus.broadcast('record/change', rdoc, null, null, body); // trigger a full update await JudgeResultCallbackContext.postJudge(rdoc, this); } @@ -169,6 +172,7 @@ export class JudgeResultCallbackContext { $set.judger = body.judger ?? 1; const rdoc = await record.update(domainId, rid, $set, $push, $unset); if (rdoc) { + body.key = 'end'; app.broadcast('record/change', rdoc, null, null, body); // trigger a full update await JudgeResultCallbackContext.postJudge(rdoc); }