Repository navigation
fix(ui): give a file that fails in a folder add a library row - #8140
Conversation
Adding a folder dropped any file that failed to index: no row, no "failed" badge, no retry, and the chat then said its answer wasn't in the documents. A file that indexed to nothing got a "complete" row and was attached anyway. Each such file now gets a failed row with its reason, which the library already offers to retry, and stays out of the chat. The folder notice also counted the folder's images as files of a type GAIA doesn't index. Images are now counted apart, and the notice says to add each one on its own so GAIA reads it. Closes amd#8138 Closes amd#8139
|
Verdict: Approve with suggestions When a folder is added, a file that fails to index now shows in the library as failed, with its reason and a retry, instead of vanishing. A file that indexes to nothing is no longer marked complete. The folder notice now counts images separately and says how to add them. The logic is sound and well tested, and the docs match the code. Two things are worth a look before merging:
Real-world evidenceN/A: no evidence bundle was produced for this run. The verdict rests on a static review. The changed route was not called, and I couldn't run the backend tests here because pytest isn't installed on the runner. The PR reports 32 backend and 34 front-end tests passing, but it has neither a screenshot of the new notice nor a replay in the app. Both are still unchecked in its test plan. Add a before→after screenshot of the folder notice in English and Arabic once the RTL scene exists. 🔍 Technical details🟡 Recording a failed row can raise inside the
This logs the error and adds it to the message the user sees, so nothing is swallowed. 🟡 Follow-up: Folder add from FileBrowser ignores The folder branch only collects 🟢 A failed row can overwrite an in-flight row for the same bytes ( The early return protects only a row that is Strengths
|
Recording a failed file's row ran inside the error handler, so a database error there turned the whole folder add into a server error and lost the files that indexed. It is now logged and added to that file's error. A row another upload is still indexing is left alone. Adding a folder from the file browser now counts the files that failed, refreshes the library to show their rows, and says how many images were left out.
Before: when you added a folder, any file that failed to index disappeared. It had no library row, no "failed" badge and no retry, and the chat then said its answer wasn't in the documents. A file that indexed to nothing was marked complete and attached anyway. The notice also called the folder's photos "a type GAIA doesn't index". After: each failed file shows in the library as failed, with its reason and the usual retry, and stays out of the chat. The notice says how many images were left out and that adding each one on its own lets GAIA read it.
The embedder reload that made a valid file fail in the first place is #8048, fixed by #8049. This PR covers what the user sees when any file in a folder fails.
Closes #8138
Closes #8139
Test plan
pytest tests/unit/chat/ui/test_library_index_errors.py tests/unit/chat/ui/test_folder_index_one_embedder_load.py: 32 passed; the 4 new tests fail onmainnpx vitest run src/components/__tests__/DocumentLibrary.test.tsx(34 passed, new English and Arabic notice tests) andnpx vitest run src/i18n(41 passed)npx tsc --noEmit -p .clean; API types regenerated from the backend modelsnpm run test:rtlscreenshots of the folder notice (not run here; the notice has no visual scene yet)🔍 Technical details
index_foldertreats a 0-chunk result as a failure, asupload_by_pathdoes. A failed file whose bytes could be hashed gets anadd_documentrow set tofailedwithlast_erroranderror_kind. A complete row for the same bytes elsewhere is left alone.errorsand the notice.skipped_imagesfield onIndexFolderResponse;skippednow counts only unsupported types.