Name search: a space is no longer found by its own name #1132

Closed
opened 2026-11-05 21:22:40 +00:00 by Cordy · 3 comments
Owner

Found in the v0.6.399 (#1102) live check on files.c0rdyceps.ch, 2026-11-05: searching folderino finds nothing although the space "Test Ümlauf folderinö" exists and the person is a member.

Cause: until v0.6.398 the search walked from /, so the listing of /spaces returned the space folders themselves as results (internal/api/search.go:137-177 at v0.6.398). The index answers each space as a reach entry with Self false (spec 7.3 of ix1102: "never returns the walked View itself"), so a space folder is never a result. Personal files and shared roots (Self true) are not affected.

Proposed fix: with homes on, a space reach entry is Self true when the search is not narrowed to that space (path= empty, / or /spaces), so the space folder itself ranks like any folder named that way; the walk fallback does the same. Test on posix and s3, homes on and off.

Found in the v0.6.399 (#1102) live check on files.c0rdyceps.ch, 2026-11-05: searching `folderino` finds nothing although the space "Test Ümlauf folderinö" exists and the person is a member. Cause: until v0.6.398 the search walked from `/`, so the listing of `/spaces` returned the space folders themselves as results (`internal/api/search.go:137-177` at v0.6.398). The index answers each space as a reach entry with `Self false` (spec 7.3 of ix1102: "never returns the walked View itself"), so a space folder is never a result. Personal files and shared roots (`Self true`) are not affected. Proposed fix: with homes on, a space reach entry is `Self true` when the search is not narrowed to that space (`path=` empty, `/` or `/spaces`), so the space folder itself ranks like any folder named that way; the walk fallback does the same. Test on posix and s3, homes on and off.
Author
Owner

Research done (Phase 1, read only, main 666c3d3b): scratch/b7e/backlog/research-1132.md.

Findings:

  • The cause is right, but Self true alone fixes only the walk fallback. The index never returns a part's root: nameindex/search.go:93 (if r.self && r.i != 0) and part.go:51. A space's own location is the root of its part, and that root has no name. The name a member sees (sp.Name) is not the backend folder the index knows.
  • Homes off is affected too. The path part excludes registered space folders "at or below" (check.go:42-55, build.go:511-518), and the walk skips them (searchwalk1102.go:82).
  • Before v0.6.399 the walk listed /spaces, so spaces were found (search.go:137-177 at v0.6.398).

Recommended (option A): mark space reach entries Self true in both homes modes. Then add, in the API, one candidate per space entry, ranked on the name in the person's view (path.Base(View)) at Depth 1 so it ties with a top-level Personal folder, and checked by the usual Stat gate. This covers the index and the walk in one place, duplicates collapse by location key, and nothing changes in the index. path=/spaces/<name> still leaves the space itself out (narrowReach makes that entry Self false).

Tests: posix and s3, homes on and off, with the index ready and with it off. Cases: accent folding (folderino), narrowed paths, non-member, Type filter, rank parity, renamed space, Load more.

Open questions: Q1 option A rather than Self only (yes), Q2 Depth 1 rather than 0 (Depth 1). Q3: on S3 a folder Stat has no time, so with a Last modified filter no folder from the index ever matches. That includes spaces. Recommendation: its own small task in this batch (details in research-1119.md). No mockup, no new strings.

Research done (Phase 1, read only, main 666c3d3b): `scratch/b7e/backlog/research-1132.md`. Findings: - The cause is right, but `Self true` alone fixes only the walk fallback. The index never returns a part's root: `nameindex/search.go:93` (`if r.self && r.i != 0`) and `part.go:51`. A space's own location is the root of its part, and that root has no name. The name a member sees (`sp.Name`) is not the backend folder the index knows. - Homes off is affected too. The `path` part excludes registered space folders "at or below" (`check.go:42-55`, `build.go:511-518`), and the walk skips them (`searchwalk1102.go:82`). - Before v0.6.399 the walk listed `/spaces`, so spaces were found (`search.go:137-177` at v0.6.398). Recommended (option A): mark space reach entries `Self true` in both homes modes. Then add, in the API, one candidate per space entry, ranked on the name in the person's view (`path.Base(View)`) at Depth 1 so it ties with a top-level Personal folder, and checked by the usual Stat gate. This covers the index and the walk in one place, duplicates collapse by location key, and nothing changes in the index. `path=/spaces/<name>` still leaves the space itself out (`narrowReach` makes that entry `Self false`). Tests: posix and s3, homes on and off, with the index ready and with it off. Cases: accent folding (`folderino`), narrowed paths, non-member, Type filter, rank parity, renamed space, Load more. Open questions: Q1 option A rather than Self only (yes), Q2 Depth 1 rather than 0 (Depth 1). Q3: on S3 a folder Stat has no time, so with a Last modified filter no folder from the index ever matches. That includes spaces. Recommendation: its own small task in this batch (details in research-1119.md). No mockup, no new strings.
Author
Owner

Decisions (Nikola, 2026-11-05): approved. Every space the person can reach is a candidate by its visible name, ranked like a top-level folder (depth 1), through the usual access check, in both homes modes, index ready or off; searching inside a space still leaves the space itself out. The S3 folder-time finding (a Last modified filter with a start date rejects every folder on S3) is fixed as its own task in batch 2.

**Decisions (Nikola, 2026-11-05):** approved. Every space the person can reach is a candidate by its visible name, ranked like a top-level folder (depth 1), through the usual access check, in both homes modes, index ready or off; searching inside a space still leaves the space itself out. The S3 folder-time finding (a Last modified filter with a start date rejects every folder on S3) is fixed as its own task in batch 2.
Author
Owner

Shipped in v0.6.400 (PR #1136), live on both dogfoods. A name search finds a space you are a member of by its visible name (homes on and off, index ready or not), a renamed space by its new name; This folder inside a space leaves the space itself out; a space you cannot open is never found. Live check on the #1005 list.

Shipped in **v0.6.400** (PR #1136), live on both dogfoods. A name search finds a space you are a member of by its visible name (homes on and off, index ready or not), a renamed space by its new name; This folder inside a space leaves the space itself out; a space you cannot open is never found. Live check on the #1005 list.
Cordy closed this issue 2026-11-06 12:13:14 +00:00
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#1132
No description provided.