From 0dc572c6faf6f8508c264eb4bb6a852839c2acf5 Mon Sep 17 00:00:00 2001
From: Hikari
Date: Mon, 9 Mar 2026 22:07:36 -0700
Subject: [PATCH] fix: use stable unique keys for quest reward list
The previous key `${reward.type}-${amount ?? ""}` collapsed to
"adventurer-" for every adventurer-unlock reward (which carries no
amount), producing duplicate-key React warnings on every render tick.
Because console.error is forwarded to the backend telemetry service,
this caused continuous email alerts.
The key now uses targetId (present on adventurer and upgrade rewards)
first, falls back to amount (present on gold/essence/crystal rewards),
and uses the map index only as a last resort.
---
apps/web/src/components/game/questPanel.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/apps/web/src/components/game/questPanel.tsx b/apps/web/src/components/game/questPanel.tsx
index 33b86dd..213f541 100644
--- a/apps/web/src/components/game/questPanel.tsx
+++ b/apps/web/src/components/game/questPanel.tsx
@@ -108,9 +108,9 @@ const QuestCard = ({
}
- {quest.rewards.map((reward) => {
+ {quest.rewards.map((reward, rewardIndex) => {
return (
-
+
{reward.type === "gold"
&& `🪙 ${formatNumber(reward.amount ?? 0)}`}
{reward.type === "essence"