Repository navigation
Batch the workspace favicon probe (#1333, #1334) - #1339
Conversation
The sidebar looked for each workspace folder's project icon by asking GET /api/fs/stat about all 33 candidate places at once, so every page load sent 33 requests per folder and logged a 404 for each missing one. Behind a reverse proxy with a rate limit the burst came back as 429s, legitimate requests included (#1333), and the 404s buried real errors in the browser console (#1334). GET /api/fs/favicon?root= now walks the candidates on the PC, best first, each read with the same findFile rules /api/fs/stat uses for an absolute path with no pane, and answers once: { icon: FileInfo | null }. A folder without an icon is a 200, not a 404. The route sits under fs/, so a watching device and another site's page are refused as for any file read, and a remote PC is asked through the same proxy allowlist as fs/stat. The client keeps one probe per PC and folder for the session. A refusal (a watching device, a bridge without the route) is remembered as no icon; a failed check (offline, a 5xx from the bridge, or a 429 from a proxy) is forgotten, so the folder is asked again next time. Measured on an isolated herdr with four workspaces: one page load went from 132 fs/stat requests (130 of them 404) and 135 console errors to 4 fs/favicon requests and no fs errors, with the same icons drawn. Closes #1333 Closes #1334 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the shared/protocol import in server/index.ts: #1338 moved the status wiring into server/core/status.ts and trimmed that import; keep its version with ProjectFavicon added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
|
Review 1 · Pass · 1 pre-existing Does the change do what the task asked? Yes. Gate: major and worse must be fixed. The favicon lookup now takes one request per PC and folder, returns ordinary misses without a 404, and keeps candidate ordering and per-session caching behavior. The server tests exercise the local and remote routes plus access restrictions, and the client tests cover deduplication and retry after failed checks. One separate preexisting worktree classification request can still log a 404 for each non-git workspace on page load. Not required (there before this change)
|
…atch-the-workspace-favicon-pr
|
Review 3 · Pass · 1 pre-existing Does the change do what the task asked? Yes. Gate: major and worse must be fixed. The change meets the favicon batching requirements: the browser uses one request per PC and folder, misses return 200 with a null icon, and failed checks are not cached. I verified the endpoint and client tests, type generation, typecheck, and observed a page load issue one favicon request for each workspace. A separate worktree-list 404 remains as a preexisting single-request-per-workspace behavior, rather than the favicon candidate burst. Not required (there before this change)
|
…atch-the-workspace-favicon-pr
|
@coderabbitai review |
✅ Action performedReview finished.
|
The branch is ready for the board to push and open the PR. With the login fixed,
ghcan now read both issues. Neither has comments and no open PR covers this, so the fix didn't change.While re-checking, I found
mainhad moved by one commit (#1338), which conflicted with my branch on one import line inserver/index.ts. #1338 had trimmed that import and I had addedProjectFaviconto it, so I keptmain's version and addedProjectFaviconback. That's in merge commit 9c9f8bd, after the fix commit b635eb3, which closes #1333 and #1334.After the merge, typecheck and build pass, and so do the favicon, access, proxy and conventions tests on the isolated herdr session.
bun run check fastends the same way as before: two unit test files fail,scripts/install-star.test.tsandserver/portal.test.ts. The #1338 commit onmainreports the same two failures on this Mac.I didn't push or open the PR myself, because my task rules leave that to the board. The closing note is updated with the merge.
Also noticed
src/components/Sidebar.tsx/server/workspace-routes.ts:/api/worktree/listlogs one 404 per non-git workspace on each page load (herdr refuses it withnot_git_worktree).scripts/install-star.test.ts: fails on a Mac with a display, onmaintoo.server/portal.test.ts: fails during the full unit run and passes on its own, so it may be flaky.Task: HWU-1 (herdr-web-ui/1)