From 5e05a1574320cf23349dbd93cab32e5dcd31f807 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Mon, 30 Jun 2025 13:28:27 -0700 Subject: [PATCH] fix: update calendar progress at daily reset (#2365) Closes #2364 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2365 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/controllers/api/inventoryController.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index 730756a1..cb855f16 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -13,7 +13,8 @@ import { allDailyAffiliationKeys, cleanupInventory, createLibraryDailyTask, - generateRewardSeed + generateRewardSeed, + getCalendarProgress } from "@/src/services/inventoryService"; import { logger } from "@/src/utils/logger"; import { addString, catBreadHash } from "@/src/helpers/stringHelpers"; @@ -108,6 +109,10 @@ export const inventoryController: RequestHandler = async (request, response) => } } + if (inventory.CalendarProgress) { + getCalendarProgress(inventory); // handle year rollover; the client expects to receive an inventory with an up-to-date CalendarProgress + } + cleanupInventory(inventory); inventory.NextRefill = new Date((today + 1) * 86400000); // tomorrow at 0 UTC