Skip to content

fix(node): avoid classifying filesystem EBUSY as SQLite busy - #78

Draft
Dailin521 wants to merge 1 commit into
mainfrom
codex/fix-node-ebusy-classification
Draft

fix(node): avoid classifying filesystem EBUSY as SQLite busy#78
Dailin521 wants to merge 1 commit into
mainfrom
codex/fix-node-ebusy-classification

Conversation

@Dailin521

Copy link
Copy Markdown
Owner

Summary

Prevent filesystem EBUSY failures from being misclassified as SQLite busy/locked errors in the Node CLI.

Root cause

isSqliteBusyError() used a generic message.includes("busy") check. Node filesystem errors such as:

EBUSY: resource busy or locked, open '...\transaction-journal.jsonl'

therefore received the misleading state_5.sqlite is currently in use guidance.

Changes

  • Match explicit SQLITE_BUSY* and SQLITE_LOCKED* codes.
  • Retain SQLite's database is locked and database table is locked messages.
  • Preserve unrelated filesystem EBUSY errors unchanged.
  • Add focused regression tests for both filesystem and SQLite cases.

User impact

Journal/file sharing failures now retain their real filesystem diagnostic instead of telling users to close Codex because SQLite is busy.

Validation

  • node --test test/sqlite-error-classification.test.js
  • npm test — 210 passed

Non-goals and follow-up draft

This PR intentionally does not change rollback or recovery behavior.

A separate follow-up should investigate and design:

  1. cross-process coordination between the Node CLI and Windows GUI for one Codex Home;
  2. read/write sharing or bounded retry behavior for transaction-journal.jsonl;
  3. resumable, idempotent recovery for journals left in rollingBack;
  4. a one-click GUI recovery action bound to the transaction backup;
  5. integration tests covering a GUI status scan racing a Node journal append.

That work should remain separate because it changes concurrency and data-integrity behavior beyond this error-classification fix.

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.

1 participant