Skip to content

fix(search): handle synchronous engine probe spawn failures - #1032

Draft
lq-kiren wants to merge 1 commit into
omdsh-dev:devfrom
lq-kiren:fix/search-engine-probe-timer
Draft

lq-kiren wants to merge 1 commit into
omdsh-dev:devfrom
lq-kiren:fix/search-engine-probe-timer

Conversation

@lq-kiren

Copy link
Copy Markdown

Fixes #995

When spawning an fd/rg probe throws synchronously, verify() calls finish(false) before its const timer has initialized. Cleanup then throws Cannot access 'timer' before initialization, rejecting the cached engine probe and preventing file search from reaching its plain-walk fallback.

Initialize the optional timer before that failure path becomes reachable. Keep its allocation after a successful spawn. A regression test forces synchronous spawn failures, verifies that searchFiles() still returns an actual matching file via the plain walk, and checks that the cached probe resolves to an empty engine list. The test reproduced the reported ReferenceError before the fix and passes afterward.

Validation:

  • Ubuntu 22.04 WSL, Node 22.20.0, pnpm 11.8.0, Git 2.51.0; DSH pinned to 0.2.1-rc.1.
  • Full Linux suite: 221 files passed; 2683 tests passed, 17 environment-dependent tests skipped. All 70 engine/search tests passed.
  • Typecheck, lint, build, pack, the original consumer-types script, and real rg/fd output checks passed.
  • Windows engine/search tests: 65 passed, 5 platform-dependent skips. Full Windows suite: 2676 passed, 6 failed, 18 skipped. The six failures match the previously reproduced baseline limitations: home-directory/symlink permissions and the existing tarball test splitting Windows tar's CRLF output only on \n.
  • Real-browser mount suite against this branch's tarball: 12 passed, 1 failed, 3 Context-profile-only tests skipped. The remaining failure is the existing host's GET /open-in-app/icon/filemanager → 404 in WSL; all preceding blank-session behavior assertions pass. Its network trace contains only that failing resource. This was independently reproduced in a host-only profile without Better Sidebar during the earlier local verification; neither host source nor the console assertion was changed.
  • Aggregate double-mount smoke passed, including the live settings handler and duplicate-mount backoff checks.

Kept as a draft because the standard mount gate is not fully green in this local WSL environment. Physical macOS hardware was not exercised; the reported ReferenceError was reproduced through the synchronous-spawn-failure regression above.

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