mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1642] [MERGED] Surface game journal load and save failures with retry #5174
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5174
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1642
Author: @Romuromylus
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @Romuromylus
Base:
refactor← Head:fix/game-journal-error-state📝 Commits (2)
1782f0aSurface game journal load and save failures with retry29b1af3Clear stale journal save error on edit and seed the retry ref📊 Changes
2 files changed (+278 additions, -11 deletions)
View changed files
➕
src/features/modes/game/components/GameJournal.test.tsx(+183 -0)📝
src/features/modes/game/components/GameJournal.tsx(+95 -11)📄 Description
Why this change
GameJournalswallowed both of its async failures in empty.catch(() => {})blocks:getJournalrejected,setJournalnever ran, so the panel stayed stuck on the "Loading journal..." spinner forever, with no error and no way out.updateNotesrejected,setNotesSaved(true)never ran, so the notes status pill stayed on the amber "Saving..." indefinitely, implying an in-flight save that had actually failed.(Note: the issue body references a
useGameJournalhook, but no such hook exists. The component uses local state, so the fix uses local state.)What changed
src/features/modes/game/components/GameJournal.tsx:loadError/saveErrorin local state.loadJournalcallback so it can be retried; on failure it records the error.saveNotesrecords its failure and clears it on success;NotesViewshows a red "Save failed" with a Retry control instead of a stuck "Saving...".Verification
pnpm exec tsc -bclean.GameJournal.test.tsx) covers: the load-error panel renders (not a stuck spinner), a successful load retry shows the journal, and a save failure surfaces "Save failed" + Retry.Risk / note
This is Game-mode-owned UI; the underlying
gameApi.getJournal/updateNotesare unchanged. The unmount-flush effect still callssaveNoteson unmount; on failure it sets error state on an unmounting component (benign React warning at most). The error panel's exact styling is verified by render, not pixel comparison.Linked issue
Closes #1536.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.