| โฆ | โฆ | @@ -294,6 +306,134 @@ function withDirectoryAncestors(entries: ReadonlyArray<ProjectEntry>): ProjectEn | |
| 420 | + | const entry = allSymlinkPaths.has(indexedEntry.path) | |
| 421 | + | ? symlinkByPath.get(indexedEntry.path) | |
| 422 | + | : indexedEntry; | |
| 423 | + | if (!entry) continue; | |
๐ High workspace/WorkspaceSearchIndex.ts:423
A file search with limit: 1 can return no entries even when actual-file was fetched: if the watcher indexes the directory symlink src-link as a file, the native limit keeps src-link and actual-file is excluded, then this correction turns src-link into a directory and the file-kind filter drops it. Apply kind correction and filtering before limiting, or refill dropped slots from the remaining matches.
๐ Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/server/src/workspace/WorkspaceSearchIndex.ts around line 423: |
| 2 | |
| 3 | A file search with `limit: 1` can return no entries even when `actual-file` was fetched: if the watcher indexes the directory symlink `src-link` as a file, the native limit keeps `src-link` and `actual-file` is excluded, then this correction turns `src-link` into a directory and the file-kind filter drops it. Apply kind correction and filtering before limiting, or refill dropped slots from the remaining matches. |
| โฆ | โฆ | @@ -410,6 +553,169 @@ export const make = Effect.fn("WorkspaceSearchIndex.make")(function* ( | |
| 596 | + | .pipe(Effect.orElseSucceed(() => undefined)); | |
| 597 | + | // Exit 1 means nothing matched. | |
| 598 | + | if (result?.exitCode === 1) return []; | |
| 599 | + | if (result?.exitCode !== 0) { | |
๐ก Medium workspace/WorkspaceSearchIndex.ts:599
When git check-ignore output exceeds 16 MiB, ignored symlinks omitted from the truncated output are included in list and search and can remain cached indefinitely. Because this branch accepts exit code 0 without checking stdoutTruncated, treat truncated output as a failure so the existing fail-closed path hides those entries.
| 1 | - if (result?.exitCode !== 0) { |
| 2 | + if (result?.exitCode !== 0 || result.stdoutTruncated) { |
๐ Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/server/src/workspace/WorkspaceSearchIndex.ts around line 599: |
| 2 | |
| 3 | When `git check-ignore` output exceeds 16 MiB, ignored symlinks omitted from the truncated output are included in `list` and `search` and can remain cached indefinitely. Because this branch accepts exit code 0 without checking `stdoutTruncated`, treat truncated output as a failure so the existing fail-closed path hides those entries. |
| โฆ | โฆ | @@ -410,6 +553,169 @@ export const make = Effect.fn("WorkspaceSearchIndex.make")(function* ( | |
| 686 | + | (event) => event.kind === "modified" && !/(^|[\\/])\.(git)?ignore$/.test(event.path), | |
| 687 | + | ); | |
| 688 | + | if (!editsOnly) invalidateSymlinkScan(); | |
| 689 | + | }; | |
๐ High workspace/WorkspaceSearchIndex.ts:684
Replacing a symlink can leave its old entry in the infinitely cached scan, so subsequent searches return the wrong kind or keep an alias whose target is outside the workspace. fff-node reports a path removed and recreated in one batch as modified, which this handler treats as harmless; invalidate the scan on modified batches too.
| 1 | - const editsOnly = events.every( |
| 2 | - (event) => event.kind === "modified" && !/(^|[\\/])\.(git)?ignore$/.test(event.path), |
| 3 | - ); |
| 4 | - if (!editsOnly) invalidateSymlinkScan(); |
| 5 | + if (events.length > 0) invalidateSymlinkScan(); |
๐ Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/server/src/workspace/WorkspaceSearchIndex.ts around lines 684-689: |
| 2 | |
| 3 | Replacing a symlink can leave its old entry in the infinitely cached scan, so subsequent searches return the wrong kind or keep an alias whose target is outside the workspace. `fff-node` reports a path removed and recreated in one batch as `modified`, which this handler treats as harmless; invalidate the scan on modified batches too. |