Skip to content
This repository was archived by the owner on Sep 17, 2026. It is now read-only.

fix(boot): always log boot-task start so a hard crash names its culprit - #81

Closed
sgeraldes wants to merge 3 commits into
beta/meeting-intelligencefrom
fix/boot-task-start-logging
Closed

sgeraldes wants to merge 3 commits into
beta/meeting-intelligencefrom
fix/boot-task-start-logging

Conversation

@sgeraldes

Copy link
Copy Markdown
Owner

Why

getBootTaskTimings() is documented as "the evidence surface for which boot task froze the app", but it is an in-memory array. A boot task that aborts the process (V8 OOM, native crash) takes that record with it, so it proves nothing about the crash it was meant to explain.

The human-readable per-task lines were QA-gated, and the documented HIDOCK_QA_LOGS=1 boot escape hatch does not survive in practice: isQaLogsEnabled() prefers the value the renderer pushes over qa:set-logs-enabled, so the renderer's persisted false closes the gate before the drain starts.

Consequence, measured: a startup OOM on this machine left [IntegrityService] Startup checks complete as the last durable line. That is the task before the failure, which framed the wrong task and left the abort unattributed for seven days. Identifying the real culprit required building from source and instrumenting the drain.

What

One unconditional console.log per boot task (~8 per boot) at task start. The last starting "..." line in any crash log now names the task that died.

Deliberately not QA-gated: a log that is off by default cannot explain a crash that already happened.

Testing

vitest run boot-scheduler.test.ts boot-tasks.test.ts — 21 passed. No test asserted the previous QA-gated string.

Verified against the real failure: with this line in place, a source build attributed the full drain (starting "database-backup" → … → Complete (8 tasks, 7328ms)).

Note

This does not fix the OOM itself. That was a stale install: the packaged app.asar (2026-07-19) predates the batched vector-store load, so it ran SELECT * FROM vector_embeddings unbatched over 232,960 rows (~2.37 GB of blobs). Both main and this branch already contain the batched fix — that install just needs rebuilding.

The per-task `timings` record is documented as the evidence surface for
"which boot task froze the app", but it lives in memory: a task that
aborts the process outright (V8 OOM, native crash) takes the record with
it. The human-readable per-task lines were QA-gated, and the documented
HIDOCK_QA_LOGS=1 escape hatch is defeated once the renderer pushes its
persisted `false` over qa:set-logs-enabled.

Net effect: a startup OOM left the last durable line coming from the
PREVIOUS task, which made the next task look innocent and kept an OOM
abort unattributed for seven days. Diagnosing it needed a source build.

Log one unconditional line per boot task (~8 per boot) so the last
"starting" line in any crash log names the task that died.
Copilot AI lite review requested due to automatic review settings August 26, 2026 13:58
@coderabbitai

coderabbitai Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 7f5cf79d-b1fd-4272-9b96-e8ba838bdf97

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is minimal and localized to logging, aligns with existing non-QA-gated operational logs in the scheduler, and carries low behavioral risk.

Pull request overview

This PR makes boot-task attribution durable across hard process crashes by logging the start of each boot task unconditionally in the Electron main process boot scheduler, so the last “starting …” line in crash logs identifies the task that died (even when in-memory timing data is lost).

Changes:

  • Emit an unconditional [BootScheduler] starting "<task>" log line immediately before each boot task runs.
  • Add inline rationale explaining why start logs must not be QA-gated (in-memory timings disappear on abort).
File summaries
File Description
apps/electron/electron/main/services/boot-scheduler.ts Adds an unconditional per-task start log to ensure crash logs identify the boot task in progress.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sonarqubecloud

Copy link
Copy Markdown

@sgeraldes

Copy link
Copy Markdown
Owner Author

The boot-task diagnostic and release-era Electron work live in HiDock Next 2.0. Closing this legacy branch PR as the monorepo is being archived.

@sgeraldes sgeraldes closed this Sep 17, 2026
@sgeraldes
sgeraldes deleted the fix/boot-task-start-logging branch September 17, 2026 01:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants