From 184d161ea34667ab9aa11858329ec378d4405947 Mon Sep 17 00:00:00 2001 From: undefined Date: Thu, 4 Sep 2025 16:40:47 +0800 Subject: [PATCH] core: fix psdoc override with same rid --- packages/hydrooj/src/model/problem.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/hydrooj/src/model/problem.ts b/packages/hydrooj/src/model/problem.ts index 8f89687a5..61a234bbf 100644 --- a/packages/hydrooj/src/model/problem.ts +++ b/packages/hydrooj/src/model/problem.ts @@ -421,7 +421,8 @@ export class ProblemModel { domainId: string, pid: number, uid: number, rid: ObjectId, status: number, score: number, ) { - const condition = status === STATUS.STATUS_ACCEPTED ? {} : { status: { $ne: STATUS.STATUS_ACCEPTED } }; + const condition = status === STATUS.STATUS_ACCEPTED ? {} + : { $or: [{ status: { $ne: STATUS.STATUS_ACCEPTED } }, { rid }] }; const res = await document.setStatusIfCondition( domainId, document.TYPE_PROBLEM, pid, uid, condition, { rid, status, score },