From 0b8df70e6f048412b16999cb037b5dfc79bb12f3 Mon Sep 17 00:00:00 2001 From: Samuel Lim Date: Wed, 13 Nov 2024 16:28:17 +0800 Subject: [PATCH 1/2] Fix forfeit not retrieving snapshot --- services/collaboration/src/controllers/roomController.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/collaboration/src/controllers/roomController.ts b/services/collaboration/src/controllers/roomController.ts index 915115237f..4aab3357cb 100644 --- a/services/collaboration/src/controllers/roomController.ts +++ b/services/collaboration/src/controllers/roomController.ts @@ -140,6 +140,9 @@ export const updateUserStatusInRoomController = async (req: Request, res: Respon return handleHttpNotFound(res, 'User not found in room'); } + // Obtain code and language + const snapshot = await retrieveSnapshot(roomId); + // Record the forfeited status in the user's history await produceUpdateHistory(roomId, userId, HistoryStatus.FORFEITED, snapshot); From ac68a969134a949af5d70a0fa6639935b336e215 Mon Sep 17 00:00:00 2001 From: Samuel Lim Date: Wed, 13 Nov 2024 16:31:38 +0800 Subject: [PATCH 2/2] oops --- services/collaboration/src/controllers/roomController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/collaboration/src/controllers/roomController.ts b/services/collaboration/src/controllers/roomController.ts index 4aab3357cb..a0918ca6cb 100644 --- a/services/collaboration/src/controllers/roomController.ts +++ b/services/collaboration/src/controllers/roomController.ts @@ -120,7 +120,7 @@ export const closeRoomController = async (req: Request, res: Response) => { export const updateUserStatusInRoomController = async (req: Request, res: Response) => { const userId = req.user.id; const { roomId } = req.params; - const { isForfeit, snapshot } = req.body; + const { isForfeit } = req.body; // Validate that isForfeit is a boolean value if (typeof isForfeit !== 'boolean') {