Skip to content

bug(platform): a failed project folder read silently hides files that loaded successfully #3736

Closed

Description

@yannickmonney

The project's Knowledge/Files screen silently drops nested files when its folder-list request fails, even if the document-list request succeeded. With only nested documents, it renders an empty bordered list without an error or Retry control. This can make retained files appear missing.

Reproduce locally

  1. Create a project with a root document and a document inside a folder. Open the project's Knowledge tab with that folder expanded (or a folderId deep link).
  2. On a fresh mount, return 503 only for GET /api/app/folders?orgId={org}&projectId={project}. Keep the project GET and GET /api/app/documents/by-project/{project}?orgId={org} successful.
  3. Let all four folder read attempts finish.

Expected: a visible folder-read failure with recovery, and no presentation implying the successfully loaded nested files disappeared.

Observed: the root file remains visible; the folder and nested file disappear. No alert, retry button or error toast is shown. When all documents are nested, the Project files list contains zero rows despite the successful document cache containing a document.

Independent evidence and controls

Parent replay: four actual-component tests pass, asserting the bug and controls. ProjectFilesTab, project/document/folder hooks, HTTP read adapters, normalization and retry policy run unchanged in jsdom. The GET transport is a closed synthetic fixture; it supplies the failure deliberately and cannot call a network. Stable auth/org/router context and unrelated policy/record-menu reads are supplied.

  • Successful populated control: root file, folder and expanded nested file are all rendered.
  • Failed mixed control: folder query settles status=error, fetchStatus=idle, fetchFailureCount=4; document query is successful with both documents; nested content is hidden without an error.
  • Successful empty control: Add files for this project is shown.
  • Recovery control: a successful folder refetch restores the nested file from the same document cache without re-fetching documents.

This is component/transport failure-state evidence, not a production outage or a full browser screenshot claim. The first parent harness run used an incorrect empty-state text expectation; it was corrected to the actual label before all four tests passed. That harness error is not a product finding.

Root cause and expected contract

app/features/projects/components/project-files-tab.tsx:280 takes document loading state but only folders from useProjectFolders. buildTree groups documents by folder ID, while rendering only walks the returned folder tree and root documents (lines 1105–1141). Folder loading/error is therefore silently treated as an empty folder array.

The behavior guide docs/en/platform/projects/manage-files.md asks users to verify each file in its intended folder and says even unindexed files remain visible in the tree. Carry folder read status into the screen and offer retry; preserve error-vs-empty semantics. This is one folder-read failure defect, not a separate finding for each tree shape.

Audit scope and reproduction record

  • Tested source: 480ee6a3e6d33c3414a2c0f8a52fded1ddc4ca2d; local-only audit on 2026-09-28.
  • Relevant source compared with origin/main 2be6c267eaf8b7a67d0e5abe1b0b3d655eb2ca25. The cause remains present; the only changes in the compared Inbox UI files are unrelated accent/filter-error affordances.
  • Full-body dedup reviewed against the all-state issue snapshot and the existing 102-finding baseline. This is one distinct cause, not an endpoint/locale variant or documented debt.
  • Parent replay log: /Users/yannick/.codex/notes/tale-1000-additional/files-next/parent-component2.log. Retained proof code lives in the same notes directory outside the repository. No production testing, real customer data, provider calls or application source edits.
  • Source links are rooted at the tested commit.
  • Severity: P2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions