[GH-ISSUE #1701] [Issue]: Preset Save & close closes before save succeeds #843

Closed
opened 2026-10-21 05:21:44 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @cha1latte on GitHub (May 31, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1701

Originally assigned to: @cha1latte on GitHub.

Summary

The preset editor's "Save & close" action closes the editor immediately after starting an async save, before the save succeeds. If the save is pending or fails, the UI can make it look like the user's changes were accepted while hiding the edited content.

Expected behavior

"Save & close" should keep the editor open until the async preset save succeeds, or keep the unsaved edits visible and show an error if the save fails.

Actual behavior

The unsaved-changes banner's "Save & close" path calls handleSave(); closePresetDetail(); synchronously. handleSave starts updatePreset.mutate(...), but closing does not wait for onSuccess, so failed or pending saves can lose the visible edit context.

Steps to reproduce

  1. Open a preset on the refactor branch.
  2. Edit the preset name or metadata so the editor becomes dirty.
  3. Click Back.
  4. Click "Save & close" in the unsaved-changes banner while the save is still pending or when the save fails.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: upstream/refactor at 18864af5
  • Run mode: code-path scout / scratch proof
  • OS + version: Windows, version not specified
  • Node + pnpm versions: Not specified
  • Rust version, if relevant: Not relevant
  • Remote Runtime URL configured? Not relevant
  • Provider, model, or integration, if relevant: Not relevant

Logs, screenshots, or video

Scout proof was captured locally in the scout worktree, not attached to this issue:

  • C:\tmp\ME-refactor-scout-b2-catalog-create-20260531\scratch\b2-preset-save-close-proof.mjs
  • C:\tmp\ME-refactor-scout-b2-catalog-create-20260531\scratch\b2-preset-save-close-proof.json

Regression notes

Not specified.

Additional context

Suspected owner file:

  • src/features/catalog/presets/components/PresetEditor.tsx

This appears distinct from PR #1694, which covers character create name trimming.

Template check

Please uncheck 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 @cha1latte on GitHub (May 31, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1701 Originally assigned to: @cha1latte on GitHub. ## Summary The preset editor's "Save & close" action closes the editor immediately after starting an async save, before the save succeeds. If the save is pending or fails, the UI can make it look like the user's changes were accepted while hiding the edited content. ## Expected behavior "Save & close" should keep the editor open until the async preset save succeeds, or keep the unsaved edits visible and show an error if the save fails. ## Actual behavior The unsaved-changes banner's "Save & close" path calls `handleSave(); closePresetDetail();` synchronously. `handleSave` starts `updatePreset.mutate(...)`, but closing does not wait for `onSuccess`, so failed or pending saves can lose the visible edit context. ## Steps to reproduce 1. Open a preset on the refactor branch. 2. Edit the preset name or metadata so the editor becomes dirty. 3. Click Back. 4. Click "Save & close" in the unsaved-changes banner while the save is still pending or when the save fails. ## Impact area <!-- Check the areas you think are relevant. Leave uncertain items unchecked. --> - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `upstream/refactor` at `18864af5` - Run mode: code-path scout / scratch proof - OS + version: Windows, version not specified - Node + pnpm versions: Not specified - Rust version, if relevant: Not relevant - Remote Runtime URL configured? Not relevant - Provider, model, or integration, if relevant: Not relevant ## Logs, screenshots, or video Scout proof was captured locally in the scout worktree, not attached to this issue: - `C:\tmp\ME-refactor-scout-b2-catalog-create-20260531\scratch\b2-preset-save-close-proof.mjs` - `C:\tmp\ME-refactor-scout-b2-catalog-create-20260531\scratch\b2-preset-save-close-proof.json` ## Regression notes Not specified. ## Additional context Suspected owner file: - `src/features/catalog/presets/components/PresetEditor.tsx` This appears distinct from PR #1694, which covers character create name trimming. ## Template check Please uncheck 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-21 05:21:44 +07:00
Author
Owner

@cha1latte commented on GitHub (May 31, 2026):

fixed in #1732

<!-- gh-comment-id:4587773388 --> @cha1latte commented on GitHub (May 31, 2026): fixed in #1732
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#843
No description provided.