[GH-ISSUE #2801] [Issue]: Roleplay: editing any chat setting wipes the applied Chat Preset + its agents/trackers for the session — useUpdateChatMetadata spreads chat.metadata (a JSON string) as an object, corrupting the cache #1427

Closed
opened 2026-10-21 05:33:39 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @kolacheee on GitHub (Jun 22, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2801

Summary

In Roleplay (and Visual Novel) mode, performing almost any Chat Settings action — toggling Memory Recall / Tool Use, editing Advanced Parameters, applying a Featured Character Card on the Trackers tab, adding/removing a lorebook, etc. — visibly resets the Chat Preset dropdown to the "Custom settings / choose a preset" placeholder and makes the preset's agents and trackers disappear from the panel.

The trigger is a metadata-merge bug in useUpdateChatMetadata (packages/client/src/hooks/use-chats.ts). At runtime, chat.metadata in the React Query cache is a JSON string (the raw DB TEXT column), but the mutation hook spreads it as if it were an object. Spreading a string into an object literal produces a character-indexed object ({ "0": "{", "1": "\"", ... }) that loses every real metadata key, including appliedChatPresetId, activeAgentIds, and agentOverrides. The drawer then reads that garbage object and the Chat Preset selection collapses to the placeholder.

Two important clarifications versus the original report title:

  • promptPresetId is NOT nulled. chat.promptPresetId is a top-level chat column, and the metadata mutation preserves it (it is carried through via ...existing). The RP Prompt Preset dropdown reads chat.promptPresetId and is unaffected. There is no code path in the metadata flow that nulls promptPresetId. What actually resets is the Chat Preset dropdown, which reads the metadata key appliedChatPresetId. The title's "promptPresetId nulled / prompt preset reset to none" wording conflates two different presets; the real victim is metadata.appliedChatPresetId.
  • The corruption is client-cache-only. The mutation request body sends only the small patch, and the server stores it correctly (see Root cause). A full page refresh re-fetches and heals the displayed state — but the in-session UX is broken and the vanished agents/trackers look like data loss to the user.

Symptom & UX impact

  • After applying a Chat Preset in a Roleplay chat, opening Chat Settings and doing almost anything resets the Chat Preset dropdown to "Custom settings / choose a preset".
  • The preset's scoped agents and trackers disappear from the panel, because metadata.activeAgentIds and metadata.agentOverrides are wiped from the cached object, so the panel renders as if no preset agents are active.
  • Effectively makes Roleplay unusable for any user who relies on Chat Presets: the act of adjusting one setting silently appears to discard the preset and its agent/tracker configuration. Refreshing restores it, but the behavior is alarming and breaks the flow.

Steps to reproduce

  1. Open a Roleplay (or Visual Novel) chat and apply a Chat Settings Preset (one that scopes agents/trackers).
  2. Open Chat Settings.
  3. Perform any of these triggering actions:
    • Toggle Memory Recall (ChatSettingsDrawer.tsx:2647 → updateMeta.mutate({ id, enableMemoryRecall }))
    • Toggle Tool Use / change Advanced Parameters
    • Click a Featured Character Card on the Trackers tab
    • Add or remove a lorebook
    • (Any of the ~100+ updateMeta.mutate call sites in the drawer)
  4. Observe: the Chat Preset dropdown resets to "Custom settings / choose a preset" and the preset's agents/trackers vanish from the panel.

Agent-toggle exception: Enabling/disabling an individual Agent also resets the Chat Preset dropdown to the placeholder, but the agents themselves stay visible. That is because the agent toggle patch writes activeAgentIds in the same mutation (ChatSettingsDrawer.tsx:2377, 6320–6325, etc.). After the string-spread wipes the cached metadata, the freshly-patched activeAgentIds key is re-applied on top, so it survives — but appliedChatPresetId is still lost, so the dropdown still resets.

Root cause

useUpdateChatMetadata in packages/client/src/hooks/use-chats.ts treats chat.metadata as an object in both the optimistic update and the success merge:

  • onMutate (line 514):
    metadata: { ...existing.metadata, ...metadata },
    
  • onSuccess (line 536):
    metadata: { ...data.metadata, ...existing.metadata },
    

But at runtime chat.metadata is a JSON string, not an object:

  • The DB column is TEXT; chatsStorage.getById returns the raw row unparsed — packages/server/src/services/storage/chats.storage.ts:246–249.
  • patchMetadata writes JSON.stringify(merged) and returns getById(id) — chats.storage.ts:404, 408 — so the PATCH response's metadata is also a string.
  • The GET /chats/:id and metadata PATCH routes pass the row through without parsing metadata (e.g. packages/server/src/routes/chats.routes.ts:286 keeps it a string).
  • The API client only parses the outer envelope: return res.json() — packages/client/src/lib/api-client.ts:130 — it does not transform metadata.
  • useChat / useChats have no select transform — use-chats.ts:167–179 — so the cache holds metadata as a string.

Spreading a string into an object literal enumerates its characters: { ...someString } → { "0": ..., "1": ..., ... }. So onMutate line 514 replaces chat.metadata in the cache with a character-indexed object that has none of the real keys. onSuccess line 536 then spreads two strings together and stays garbage. (Verified with node: appliedChatPresetId, activeAgentIds, agentOverrides all become undefined.)

Why the drawer shows the placeholder:

  • ChatSettingsDrawer.tsx:618–621 defensively JSON.parses metadata only when it is a string. After corruption it is already an object, so the parse is skipped and the garbage object is used directly.
  • appliedPresetId = metadata.appliedChatPresetId ?? null — ChatSettingsDrawer.tsx:2222 — is now null.
  • chatPresetSelectValue therefore falls back to CHAT_PRESET_UNAPPLIED_SELECT_VALUE (the placeholder) — ChatSettingsDrawer.tsx:2231–2232.
  • Preset agents/trackers vanish because metadata.activeAgentIds / metadata.agentOverrides are gone.

Why the RP Prompt Preset dropdown is safe: it reads chat.promptPresetId (a top-level column), e.g. ChatSettingsDrawer.tsx:622, and that column is preserved through ...existing in the metadata merge. Only metadata keys are corrupted.

Why the agent enable/disable action is the safe(r) exception: those patches include activeAgentIds in the same mutation body (ChatSettingsDrawer.tsx:2377, 6320–6325). The spread order re-applies that key on top of the corrupted object, so activeAgentIds survives — but appliedChatPresetId is still wiped, so the Chat Preset dropdown still resets.

Regression origin: introduced by commit dfc55305 ("Fix remaining issue sweep regressions"), which added the optimistic onMutate object-spread and changed onSuccess to { ...data.metadata, ...existing.metadata }. The prior commit caca4e0d wrote metadata: data.metadata (the server string) with no onMutate and was string-safe. (Note: the original investigation named caca4e0d as the regression — that is off by one; git log -L on the hook confirms dfc55305.)

The server is not at fault: patchMetadata parses, merges, and re-stringifies only the metadata column and never touches promptPresetId.

Suggested fix

Make useUpdateChatMetadata tolerant of string-or-object metadata by parsing both sides before merging. The client already treats metadata as string-or-object in ~20 places (parseChatMetadata, guards at ChatSettingsDrawer.tsx:565/619, use-game.ts:141, GameInput.tsx:135, use-scene.ts:121, etc.), so merging into a valid object (no re-stringify needed) is the minimal correct change:

const readMeta = (m: unknown): Record<string, unknown> => {
  if (typeof m !== "string") return (m ?? {}) as Record<string, unknown>;
  try {
    const p = JSON.parse(m);
    return p && typeof p === "object" && !Array.isArray(p) ? (p as Record<string, unknown>) : {};
  } catch {
    return {};
  }
};

// onMutate (was line 514):
metadata: { ...readMeta(existing.metadata), ...metadata },

// onSuccess (was line 536):
metadata: { ...readMeta(data.metadata), ...readMeta(existing.metadata) },

Keep the onMutate optimistic update and the onSuccess "keep newer optimistic metadata on top" ordering — those were added deliberately in dfc55305 to stop an older in-flight metadata PATCH response from clobbering a concurrent edit. (Note: the original investigation proposed removing onMutate and writing the server response straight into the cache; that is string-safe but partially reverts the concurrency fix and drops optimistic responsiveness, so prefer the parse-merge above.)

Durable hardening (recommended, separate but ideally same PR): add a select to useChat/useChats (use-chats.ts:167–179) that parses metadata to an object exactly once, so the cache representation is consistently an object and future spreads are always valid:

return useQuery({
  queryKey: chatKeys.detail(id ?? ""),
  queryFn: () => api.get<Chat>(`/chats/${id}`),
  select: (chat) => ({ ...chat, metadata: readMeta(chat.metadata) as ChatMetadata }),
  // ...
});

This is lower risk than the investigation's alternative of retyping Chat.metadata as string at the API boundary, which would force touching many object-style consumers (e.g. ChatSidebar.tsx:60 chat.metadata?.tags).

Validate with pnpm check. Per CLAUDE.md, target the staging branch.

Affected files

  • packages/client/src/hooks/use-chats.ts — useUpdateChatMetadata onMutate (~514) and onSuccess (~536); optional select in useChat/useChats (~167–179). Primary fix.
  • packages/client/src/components/chat/ChatSettingsDrawer.tsx — consumer that surfaces the symptom (metadata memo at 618–621; appliedChatPresetId at 2222; chatPresetSelectValue at 2231–2232; Memory Recall toggle at 2647; agent-toggle patches at 2377 / 6320–6325). No change strictly required if the hook is fixed, but useful for verification.
  • packages/shared/src/types/chat.ts — Chat.metadata is typed ChatMetadata (line 92) while it is a string at the API boundary; relevant context for the select-based hardening. Only edit if pursuing the type-level approach.

Validation

  • pnpm install
  • pnpm check passes (TypeScript + ESLint)
  • Apply the parse-merge fix in useUpdateChatMetadata (onMutate and onSuccess)
  • (If included) select parses metadata once in useChat/useChats
  • Manual: in a Roleplay chat, select/apply a Chat Preset that scopes agents/trackers; confirm the Chat Preset dropdown shows it and its agents/trackers appear
  • Manual: toggle Memory Recall → confirm the Chat Preset + its agents/trackers persist (no reset to placeholder)
  • Manual: toggle Tool Use / change Advanced Parameters → confirm the preset persists
  • Manual: click a Featured Character Card on the Trackers tab → confirm the preset persists
  • Manual: add and remove a lorebook → confirm the preset persists
  • Manual: enable/disable an individual Agent → confirm both the agents and the Chat Preset persist (the agent-toggle exception no longer drops appliedChatPresetId)
  • Manual: confirm the RP Prompt Preset dropdown (chat.promptPresetId) is unaffected before and after
  • Manual: without refreshing, perform several settings actions in a row and confirm appliedChatPresetId, activeAgentIds, and agentOverrides survive in the cached chat
  • Manual: verify in both Brave and Firefox on Linux (original repro environment)

AI-investigated against released 2.0.0; verify before fixing.

Originally created by @kolacheee on GitHub (Jun 22, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2801 ## Summary In Roleplay (and Visual Novel) mode, performing almost any Chat Settings action — toggling Memory Recall / Tool Use, editing Advanced Parameters, applying a Featured Character Card on the Trackers tab, adding/removing a lorebook, etc. — visibly resets the **Chat Preset** dropdown to the "Custom settings / choose a preset" placeholder and makes the preset's agents and trackers disappear from the panel. The trigger is a metadata-merge bug in `useUpdateChatMetadata` (`packages/client/src/hooks/use-chats.ts`). At runtime, `chat.metadata` in the React Query cache is a **JSON string** (the raw DB `TEXT` column), but the mutation hook spreads it as if it were an object. Spreading a string into an object literal produces a character-indexed object (`{ "0": "{", "1": "\"", ... }`) that loses every real metadata key, including `appliedChatPresetId`, `activeAgentIds`, and `agentOverrides`. The drawer then reads that garbage object and the Chat Preset selection collapses to the placeholder. Two important clarifications versus the original report title: - **`promptPresetId` is NOT nulled.** `chat.promptPresetId` is a top-level chat **column**, and the metadata mutation preserves it (it is carried through via `...existing`). The RP **Prompt Preset** dropdown reads `chat.promptPresetId` and is unaffected. There is no code path in the metadata flow that nulls `promptPresetId`. What actually resets is the **Chat Preset** dropdown, which reads the metadata **key** `appliedChatPresetId`. The title's "promptPresetId nulled / prompt preset reset to none" wording conflates two different presets; the real victim is `metadata.appliedChatPresetId`. - The corruption is **client-cache-only**. The mutation request body sends only the small patch, and the server stores it correctly (see Root cause). A full page refresh re-fetches and heals the displayed state — but the in-session UX is broken and the vanished agents/trackers look like data loss to the user. ## Symptom & UX impact - After applying a Chat Preset in a Roleplay chat, opening Chat Settings and doing almost anything resets the **Chat Preset** dropdown to "Custom settings / choose a preset". - The preset's scoped agents and trackers disappear from the panel, because `metadata.activeAgentIds` and `metadata.agentOverrides` are wiped from the cached object, so the panel renders as if no preset agents are active. - Effectively makes Roleplay unusable for any user who relies on Chat Presets: the act of adjusting one setting silently appears to discard the preset and its agent/tracker configuration. Refreshing restores it, but the behavior is alarming and breaks the flow. ## Steps to reproduce 1. Open a Roleplay (or Visual Novel) chat and apply a Chat Settings Preset (one that scopes agents/trackers). 2. Open Chat Settings. 3. Perform any of these triggering actions: - Toggle **Memory Recall** (`ChatSettingsDrawer.tsx:2647` → `updateMeta.mutate({ id, enableMemoryRecall })`) - Toggle **Tool Use** / change **Advanced Parameters** - Click a **Featured Character Card** on the **Trackers** tab - **Add or remove a lorebook** - (Any of the ~100+ `updateMeta.mutate` call sites in the drawer) 4. Observe: the **Chat Preset** dropdown resets to "Custom settings / choose a preset" and the preset's agents/trackers vanish from the panel. **Agent-toggle exception:** Enabling/disabling an individual **Agent** also resets the Chat Preset dropdown to the placeholder, but the agents themselves stay visible. That is because the agent toggle patch writes `activeAgentIds` in the *same* mutation (`ChatSettingsDrawer.tsx:2377`, `6320–6325`, etc.). After the string-spread wipes the cached metadata, the freshly-patched `activeAgentIds` key is re-applied on top, so it survives — but `appliedChatPresetId` is still lost, so the dropdown still resets. ## Root cause `useUpdateChatMetadata` in `packages/client/src/hooks/use-chats.ts` treats `chat.metadata` as an object in both the optimistic update and the success merge: - `onMutate` (line 514): ```ts metadata: { ...existing.metadata, ...metadata }, ``` - `onSuccess` (line 536): ```ts metadata: { ...data.metadata, ...existing.metadata }, ``` But at runtime `chat.metadata` is a **JSON string**, not an object: - The DB column is `TEXT`; `chatsStorage.getById` returns the raw row unparsed — `packages/server/src/services/storage/chats.storage.ts:246–249`. - `patchMetadata` writes `JSON.stringify(merged)` and returns `getById(id)` — `chats.storage.ts:404`, `408` — so the PATCH response's `metadata` is also a string. - The `GET /chats/:id` and metadata PATCH routes pass the row through without parsing `metadata` (e.g. `packages/server/src/routes/chats.routes.ts:286` keeps it a string). - The API client only parses the outer envelope: `return res.json()` — `packages/client/src/lib/api-client.ts:130` — it does not transform `metadata`. - `useChat` / `useChats` have **no `select` transform** — `use-chats.ts:167–179` — so the cache holds `metadata` as a string. Spreading a string into an object literal enumerates its characters: `{ ...someString }` → `{ "0": ..., "1": ..., ... }`. So `onMutate` line 514 replaces `chat.metadata` in the cache with a character-indexed object that has **none** of the real keys. `onSuccess` line 536 then spreads two strings together and stays garbage. (Verified with `node`: `appliedChatPresetId`, `activeAgentIds`, `agentOverrides` all become `undefined`.) Why the drawer shows the placeholder: - `ChatSettingsDrawer.tsx:618–621` defensively `JSON.parse`s `metadata` **only when it is a string**. After corruption it is already an *object*, so the parse is skipped and the garbage object is used directly. - `appliedPresetId = metadata.appliedChatPresetId ?? null` — `ChatSettingsDrawer.tsx:2222` — is now `null`. - `chatPresetSelectValue` therefore falls back to `CHAT_PRESET_UNAPPLIED_SELECT_VALUE` (the placeholder) — `ChatSettingsDrawer.tsx:2231–2232`. - Preset agents/trackers vanish because `metadata.activeAgentIds` / `metadata.agentOverrides` are gone. Why the RP **Prompt Preset** dropdown is safe: it reads `chat.promptPresetId` (a top-level column), e.g. `ChatSettingsDrawer.tsx:622`, and that column is preserved through `...existing` in the metadata merge. Only metadata **keys** are corrupted. Why the agent enable/disable action is the safe(r) exception: those patches include `activeAgentIds` in the same mutation body (`ChatSettingsDrawer.tsx:2377`, `6320–6325`). The spread order re-applies that key on top of the corrupted object, so `activeAgentIds` survives — but `appliedChatPresetId` is still wiped, so the Chat Preset dropdown still resets. **Regression origin:** introduced by commit `dfc55305` ("Fix remaining issue sweep regressions"), which added the optimistic `onMutate` object-spread and changed `onSuccess` to `{ ...data.metadata, ...existing.metadata }`. The prior commit `caca4e0d` wrote `metadata: data.metadata` (the server **string**) with no `onMutate` and was string-safe. (Note: the original investigation named `caca4e0d` as the regression — that is off by one; `git log -L` on the hook confirms `dfc55305`.) The server is not at fault: `patchMetadata` parses, merges, and re-stringifies only the metadata column and never touches `promptPresetId`. ## Suggested fix Make `useUpdateChatMetadata` tolerant of string-or-object metadata by parsing both sides before merging. The client already treats metadata as string-or-object in ~20 places (`parseChatMetadata`, guards at `ChatSettingsDrawer.tsx:565`/`619`, `use-game.ts:141`, `GameInput.tsx:135`, `use-scene.ts:121`, etc.), so merging into a valid **object** (no re-stringify needed) is the minimal correct change: ```ts const readMeta = (m: unknown): Record<string, unknown> => { if (typeof m !== "string") return (m ?? {}) as Record<string, unknown>; try { const p = JSON.parse(m); return p && typeof p === "object" && !Array.isArray(p) ? (p as Record<string, unknown>) : {}; } catch { return {}; } }; // onMutate (was line 514): metadata: { ...readMeta(existing.metadata), ...metadata }, // onSuccess (was line 536): metadata: { ...readMeta(data.metadata), ...readMeta(existing.metadata) }, ``` Keep the `onMutate` optimistic update and the `onSuccess` "keep newer optimistic metadata on top" ordering — those were added deliberately in `dfc55305` to stop an older in-flight metadata PATCH response from clobbering a concurrent edit. (Note: the original investigation proposed *removing* `onMutate` and writing the server response straight into the cache; that is string-safe but partially reverts the concurrency fix and drops optimistic responsiveness, so prefer the parse-merge above.) **Durable hardening (recommended, separate but ideally same PR):** add a `select` to `useChat`/`useChats` (`use-chats.ts:167–179`) that parses `metadata` to an object exactly once, so the cache representation is consistently an object and future spreads are always valid: ```ts return useQuery({ queryKey: chatKeys.detail(id ?? ""), queryFn: () => api.get<Chat>(`/chats/${id}`), select: (chat) => ({ ...chat, metadata: readMeta(chat.metadata) as ChatMetadata }), // ... }); ``` This is lower risk than the investigation's alternative of retyping `Chat.metadata` as `string` at the API boundary, which would force touching many object-style consumers (e.g. `ChatSidebar.tsx:60` `chat.metadata?.tags`). Validate with `pnpm check`. Per `CLAUDE.md`, target the **`staging`** branch. ## Affected files - `packages/client/src/hooks/use-chats.ts` — `useUpdateChatMetadata` `onMutate` (~514) and `onSuccess` (~536); optional `select` in `useChat`/`useChats` (~167–179). **Primary fix.** - `packages/client/src/components/chat/ChatSettingsDrawer.tsx` — consumer that surfaces the symptom (`metadata` memo at 618–621; `appliedChatPresetId` at 2222; `chatPresetSelectValue` at 2231–2232; Memory Recall toggle at 2647; agent-toggle patches at 2377 / 6320–6325). No change strictly required if the hook is fixed, but useful for verification. - `packages/shared/src/types/chat.ts` — `Chat.metadata` is typed `ChatMetadata` (line 92) while it is a string at the API boundary; relevant context for the `select`-based hardening. Only edit if pursuing the type-level approach. ## Validation - [ ] `pnpm install` - [ ] `pnpm check` passes (TypeScript + ESLint) - [ ] Apply the parse-merge fix in `useUpdateChatMetadata` (`onMutate` and `onSuccess`) - [ ] (If included) `select` parses `metadata` once in `useChat`/`useChats` - [ ] Manual: in a Roleplay chat, select/apply a Chat Preset that scopes agents/trackers; confirm the Chat Preset dropdown shows it and its agents/trackers appear - [ ] Manual: toggle **Memory Recall** → confirm the Chat Preset + its agents/trackers persist (no reset to placeholder) - [ ] Manual: toggle **Tool Use** / change **Advanced Parameters** → confirm the preset persists - [ ] Manual: click a **Featured Character Card** on the **Trackers** tab → confirm the preset persists - [ ] Manual: **add and remove a lorebook** → confirm the preset persists - [ ] Manual: enable/disable an individual **Agent** → confirm both the agents and the Chat Preset persist (the agent-toggle exception no longer drops `appliedChatPresetId`) - [ ] Manual: confirm the RP **Prompt Preset** dropdown (`chat.promptPresetId`) is unaffected before and after - [ ] Manual: without refreshing, perform several settings actions in a row and confirm `appliedChatPresetId`, `activeAgentIds`, and `agentOverrides` survive in the cached chat - [ ] Manual: verify in both Brave and Firefox on Linux (original repro environment) --- *AI-investigated against released 2.0.0; verify before fixing.*
Author
Owner

@kolacheee commented on GitHub (Jun 22, 2026):

Related: #2769 (Advanced Parameters baking defaults into chat-level overrides) also surfaces as a "preset looks reset" symptom when editing Advanced Parameters. They are distinct mechanisms — #2769 is the AdvancedParametersSection override-baking; THIS issue (#2801) is the broader cache-corruption (useUpdateChatMetadata spreading the chat.metadata JSON string as an object), which is what resets the applied Chat Preset + its agents/trackers across the ~8 other triggers (Memory Recall, Tool Use, Featured Card, lorebook add/remove, etc.). Fixing #2801 addresses the dominant cause; #2769 should still be fixed for the override-precedence half.

<!-- gh-comment-id:4771811000 --> @kolacheee commented on GitHub (Jun 22, 2026): Related: #2769 (Advanced Parameters baking defaults into chat-level overrides) also surfaces as a "preset looks reset" symptom when editing Advanced Parameters. They are **distinct mechanisms** — #2769 is the AdvancedParametersSection override-baking; THIS issue (#2801) is the broader cache-corruption (`useUpdateChatMetadata` spreading the `chat.metadata` JSON string as an object), which is what resets the **applied Chat Preset** + its agents/trackers across the ~8 other triggers (Memory Recall, Tool Use, Featured Card, lorebook add/remove, etc.). Fixing #2801 addresses the dominant cause; #2769 should still be fixed for the override-precedence half.
Author
Owner

@SpicyMarinara commented on GitHub (Jun 22, 2026):

Verified and addressed in PR #2790 / commit acab1fba: chat metadata updates normalize JSON-string metadata before merging, so editing settings no longer spreads a serialized metadata string into cache and resets the active preset/session state.

<!-- gh-comment-id:4772440964 --> @SpicyMarinara commented on GitHub (Jun 22, 2026): Verified and addressed in PR #2790 / commit acab1fba: chat metadata updates normalize JSON-string metadata before merging, so editing settings no longer spreads a serialized metadata string into cache and resets the active preset/session state.
Author
Owner

@kolacheee commented on GitHub (Jun 22, 2026):

Severe downstream consequence: in Game Mode, this metadata-cache corruption can drop gameId, which flips an existing campaign to the Game Setup Wizard — and clicking Cancel there triggers an unconfirmed hard-delete of the whole campaign (chat + all game state/checkpoints/images, irrecoverable). Tracked in #2804. Note: PR #2790 fixes the corruption here (#2801) — which disarms the Spotify-agent trigger — but does not remove the auto-delete trap itself (#2804), which still fires when gameSessionStatus === 'setup' or gameId is otherwise transiently absent.

<!-- gh-comment-id:4773300655 --> @kolacheee commented on GitHub (Jun 22, 2026): Severe downstream consequence: in **Game Mode**, this metadata-cache corruption can drop `gameId`, which flips an existing campaign to the Game Setup Wizard — and clicking **Cancel** there triggers an **unconfirmed hard-delete of the whole campaign** (chat + all game state/checkpoints/images, irrecoverable). Tracked in #2804. Note: PR #2790 fixes the corruption here (#2801) — which disarms the Spotify-agent trigger — but does **not** remove the auto-delete trap itself (#2804), which still fires when `gameSessionStatus === 'setup'` or `gameId` is otherwise transiently absent.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1427
No description provided.