Skip to content

feat: enhance crash handling - #906

Merged
Mivik merged 8 commits into
mainfrom
feat-crash-log
Oct 23, 2026
Merged

Mivik merged 8 commits into
mainfrom
feat-crash-log

Conversation

@NuanRMxi

Copy link
Copy Markdown
Member

增加了崩溃时的异常界面以及日志导出相关功能

NuanRMxi and others added 8 commits October 15, 2026 23:46
Replace the hand-rolled LogManager file handling, which rewrote the
whole daily file on every appended line and trimmed the newest lines
instead of the oldest, with tracing-appender's RollingFileAppender
(daily rotation, 7-file retention).

Writes go through a dedicated writer thread with an acknowledged
Flush message (WorkerGuard exposes no public flush), and every export
zip gains a 64 KiB in-memory log tail that survives a wedged or
crashed writer. Setting up the logs directory can no longer fail
game startup; file logging simply stays disabled.

Co-Authored-By: Claude Code <noreply@anthropic.com>
- Uncaught update/render errors show a dismissible dialog again
  instead of always tearing down into the crash scene; only panics
  escalate, and record_error is gone with the fatal path.
- Only a panic on the frame-loop thread records a crash; worker
  threads keep their local recovery paths (e.g. the library export
  thread's error dialog) and are still logged to file.
- The crash scene exports logs on a background thread, matching the
  settings page, so deflating a week of logs cannot ANR the app.
- Main::replace_scene drops any open dialog instead of letting it
  overlay the crash scene with listeners into destroyed scenes.
- The crash-record poll runs after the paused wait, so a crash while
  backgrounded (surface destroyed on Android) only switches scenes
  after resume.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The export slot is shared by every export flow, and the Android and
OHOS pickers deliver their fd asynchronously. Nothing blocked
navigation during that window, so leaving settings let LibraryPage's
unconditional take_export() swallow (and close) the pending config
with no output file and no error.

LibraryPage now only claims the slot while an export of its own is
pending, and SettingsPage locks touch and back for the whole export
(export_busy). The pickers report no cancellation, so a pending
export is dropped when the page resumes with an empty slot (the
fullscreen picker dismissed; Android delivers the fd before
onResume), with a game-time deadline as backstop for pickers that
never pause the app.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Mivik
Mivik merged commit 504eb91 into main Oct 23, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants