[GH-ISSUE #260] [Issue]: Can't remove background. #104

Closed
opened 2026-10-20 17:25:10 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Dark-Thoughts on GitHub (Apr 27, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/260

Summary

When removing the background from a chat and you switch back & forth, the previous background will just return.

Expected behavior

Background should stay removed.

Actual behavior

Background switches back.

Steps to reproduce

  1. Set a background in a chat.
  2. Remove the background.
  3. Switch to another chat.
  4. Switch back.

Environment

  • Marinara Engine version: v1.5.5
  • Install type: Git
  • OS + version: Bazzite:unstable
  • Browser or app shell: Firefox

Logs, screenshots, or video

Additional context

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • [ ] I DID NOT read this template and provide the requested details.
Originally created by @Dark-Thoughts on GitHub (Apr 27, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/260 ## Summary When removing the background from a chat and you switch back & forth, the previous background will just return. ## Expected behavior Background should stay removed. ## Actual behavior Background switches back. ## Steps to reproduce 1. Set a background in a chat. 2. Remove the background. 3. Switch to another chat. 4. Switch back. ## Environment - Marinara Engine version: v1.5.5 - Install type: Git - OS + version: Bazzite:unstable - Browser or app shell: Firefox ## Logs, screenshots, or video - ## Additional context - ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:25:10 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@LukaTheHero commented on GitHub (Apr 28, 2026):

Fix is up in #275.

Three compounding issues were causing this. The most stubborn one was a stale React Query cache: `useUpdateChatMetadata` only invalidated the chat detail without writing the server response into the cache, so if the mutation completed after navigating away (or under certain switch-orderings), the cache held the pre-removal snapshot and the restore effect re-applied the supposedly-removed background. The Settings Remove handler also relied on a debounced effect chain that occasionally dropped the write, and the chat-switch restore effect only ever set the background, never cleared it — so a stale URL from a previous chat could leak through.

PR fixes all three:

  • The metadata mutation now writes the server response into the cache directly.
  • The Remove handler fires the persist mutation from the click, no debounce.
  • The chat-switch restore effect mirrors metadata exactly, including null.

Verified locally: removed background now sticks across refreshes and chat switches in both directions.

<!-- gh-comment-id:4332873075 --> @LukaTheHero commented on GitHub (Apr 28, 2026): Fix is up in #275. Three compounding issues were causing this. The most stubborn one was a stale React Query cache: \`useUpdateChatMetadata\` only invalidated the chat detail without writing the server response into the cache, so if the mutation completed after navigating away (or under certain switch-orderings), the cache held the pre-removal snapshot and the restore effect re-applied the supposedly-removed background. The Settings Remove handler also relied on a debounced effect chain that occasionally dropped the write, and the chat-switch restore effect only ever *set* the background, never *cleared* it — so a stale URL from a previous chat could leak through. PR fixes all three: - The metadata mutation now writes the server response into the cache directly. - The Remove handler fires the persist mutation from the click, no debounce. - The chat-switch restore effect mirrors metadata exactly, including null. Verified locally: removed background now sticks across refreshes and chat switches in both directions.
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#104
No description provided.