Skip to content

fix(electron): guard POSIX-only O_NONBLOCK assertion on Windows - #367

Open
rqaefaqa wants to merge 2 commits into
floatboatai:mainfrom
rqaefaqa:fix/electron-windows-tests
Open

rqaefaqa wants to merge 2 commits into
floatboatai:mainfrom
rqaefaqa:fix/electron-windows-tests

Conversation

@rqaefaqa

Copy link
Copy Markdown

Summary / 摘要

Fix the remaining Windows-only test failure (O_NONBLOCK assertion) and add regression coverage asserting LinkIndex behaves identically for \-separated paths — the normalization contract #77 relied on.

Motivation / 背景与动机

Related to #77 (same class of Windows-only test assumptions). #77's path-separator half was fixed in bb83c3a, but the full suite on Windows 11 still shows one real failure: constants.O_NONBLOCK is undefined on Windows, so openedFlags & constants.O_NONBLOCK evaluates to +0 and the unconditional assertion fails. Test-only change — OpenSpec not required (CONTRIBUTING §3.1).

Changes / 变更内容

  • test/plugin-host-broker.test.ts: guard the O_NONBLOCK assertion with the same !== undefined check the test already uses for O_NOFOLLOW two lines below. Production code already passes (constants.O_NONBLOCK ?? 0) — no production change needed.
  • test/link-index.test.ts: new path separator normalization describe — \-separated indexing produces results identical to / input (names/files/resolve/backlinks/unlinked mentions), and incremental ops (updateFile/renameFile/removeFile) plus mixed-separator lookups normalize correctly. Deterministic on any OS.

Testing / 测试

  • pnpm test — 900/900 on Windows 11, Node 22.20.0, pnpm 9.15.4 (was 1 failed / 898 total before)
  • pnpm typecheck + pnpm build — pass on Windows
  • New vitest cases: 2 path separator normalization tests + guarded O_NONBLOCK assertion

Compliance / 合规自检

  • AI disclosure: drafting/research AI-assisted; diagnosis verified on real Windows before & after; changes reviewed line-by-line.
  • CLA — will sign on the bot's prompt (first-time contributor)
  • No new dependencies / build artifacts / secrets

Checklist / 自检清单

  • Conventional Commits title; test-only change — no public API, no live-preview-table.ts, no capability/breaking change
  • In scope per GOVERNANCE.md §4 (apps/electron-demo)

@CLAassistant

CLAassistant commented Sep 23, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

No deployments
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