[PR #873] [MERGED] fix: preserve game state when clearing automation data #4813

Closed
opened 2026-10-22 04:10:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/873
Author: @NeoKazuya
Created: 5/15/2026
Status: ✅ Merged
Merged: 5/15/2026
Merged by: @Romuromylus

Base: staging ← Head: fix/preserve-game-state-on-automation-expunge


📝 Commits (2)

  • 4ae083e fix: preserve game state when clearing automation data
  • 817ad17 Merge branch 'staging' into fix/preserve-game-state-on-automation-expunge

📊 Changes

1 file changed (+0 additions, -1 deletions)

View changed files

📝 packages/server/src/routes/admin.routes.ts (+0 -1)

📄 Description

Linked issue

Closes #872

Why this change

Clearing the "Automation & Themes" data scope should not erase saved game state from chats that remain in the app. The current expunge route deletes game_state_snapshots under the automation scope, so a user can keep the chat transcript but lose scene/progress state after clearing unrelated Automation & Themes data.

What changed

  • Stop deleting game_state_snapshots when only the automation scope is expunged.
  • Keep deleting game_state_snapshots through the Chats & Messages scope, so Clear All Data still removes game state.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • On the patch branch, reviewed packages/server/src/routes/admin.routes.ts and confirmed game_state_snapshots is no longer deleted in the automation scope.
  • Confirmed game_state_snapshots is still deleted in the chats scope, so Chats & Messages and Clear All Data still remove saved game state when chat data is intentionally removed.
  • Confirmed Settings -> Advanced -> Danger Zone still sends scopes: ["automation"] to /api/admin/expunge. The patch only changes the server delete list for that scope.
  • Ran pnpm --filter @marinara-engine/server lint successfully on the patch branch.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

The existing Settings -> Advanced -> Danger Zone UI exposes "Automation & Themes" as an individual clear-data checkbox and sends the selected scope list to /api/admin/expunge.

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted data expungement in admin operations to correct which data types are included in cleanup processes.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/873 **Author:** [@NeoKazuya](https://github.com/NeoKazuya) **Created:** 5/15/2026 **Status:** ✅ Merged **Merged:** 5/15/2026 **Merged by:** [@Romuromylus](https://github.com/Romuromylus) **Base:** `staging` ← **Head:** `fix/preserve-game-state-on-automation-expunge` --- ### 📝 Commits (2) - [`4ae083e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4ae083eeac126578fc8e87fd49b46309a9d5e9c9) fix: preserve game state when clearing automation data - [`817ad17`](https://github.com/Pasta-Devs/Marinara-Engine/commit/817ad176966a48f6bc82689b692e76792a263bf2) Merge branch 'staging' into fix/preserve-game-state-on-automation-expunge ### 📊 Changes **1 file changed** (+0 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/admin.routes.ts` (+0 -1) </details> ### 📄 Description ## Linked issue Closes #872 ## Why this change Clearing the "Automation & Themes" data scope should not erase saved game state from chats that remain in the app. The current expunge route deletes `game_state_snapshots` under the automation scope, so a user can keep the chat transcript but lose scene/progress state after clearing unrelated Automation & Themes data. ## What changed - Stop deleting `game_state_snapshots` when only the automation scope is expunged. - Keep deleting `game_state_snapshots` through the Chats & Messages scope, so Clear All Data still removes game state. ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - On the patch branch, reviewed `packages/server/src/routes/admin.routes.ts` and confirmed `game_state_snapshots` is no longer deleted in the `automation` scope. - Confirmed `game_state_snapshots` is still deleted in the `chats` scope, so Chats & Messages and Clear All Data still remove saved game state when chat data is intentionally removed. - Confirmed Settings -> Advanced -> Danger Zone still sends `scopes: ["automation"]` to `/api/admin/expunge`. The patch only changes the server delete list for that scope. - Ran `pnpm --filter @marinara-engine/server lint` successfully on the patch branch. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) The existing Settings -> Advanced -> Danger Zone UI exposes "Automation & Themes" as an individual clear-data checkbox and sends the selected scope list to `/api/admin/expunge`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Adjusted data expungement in admin operations to correct which data types are included in cleanup processes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:52 +07:00
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#4813
No description provided.