Repository navigation
feat(dashboard): report document imports to the status island (#2004) - #2042
Merged
doobidoo merged 3 commits intoNov 16, 2026
Merged
Conversation
…oo#2004) monitorUploadProgress() now hands every GET /api/documents/status/{id} answer to the status island as its own source, upload-<id>, labelled with the file name: busy while queued (unknown progress) or processing (measured progress), success without settle when completed, and a dismissible error with the first server error when failed. Parallel imports are separate rows; a failed poll keeps the last state. The poll now stops only on completed or failed, so a batch that reaches 100% before it is marked completed still ends with a confirmation. Adds island.upload.{queued,processing,completed,failed} to all eleven catalogs and node tests that drive the real poll against the real island model. Closes doobidoo#2004
…sland (doobidoo#2004) process_batch_upload() answers "completed" once any chunk was stored, even when other files or chunks failed. Such an import showed "Imported" and left the island after five seconds, so readers on other tabs never learned that content was missing. A completed import whose errors list is not empty now reports a dismissible error with the first error, under the new catalog key island.upload.partial ("Imported with errors: {error}") in all eleven catalogs. Adds a completed-with-errors node test.
doobidoo
enabled auto-merge (squash)
November 16, 2026 16:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
A document import now reports to the status island as its own row, named after the file, so its progress is visible from every tab and not only while the Documents tab is open.
Why
Closes #2004
monitorUploadProgress(uploadId)polledGET /api/documents/status/{upload_id}every two seconds, but the answer only reached the Documents tab's upload history.What I did, following the issue:
monitorUploadProgress()hands every poll answer to a new_reportUpload(uploadId, answer), which reports sourceupload-<uploadId>with the file name as label ({ fallback: filename }, no key).queued:busywithprogress: 'unknown'.processing:busywithprogressfrom the answer.completed:successwithoutsettle, so the row leaves by itself after five seconds.failed:errorwithdismissible: trueand the first entry oferrorsas text. Iferrorsis empty, the new catalog textisland.upload.failed("Import failed") is used instead.catch, which retries after five seconds and reports nothing, so the row keeps its last state.this.statusIslandnull check, so the dashboard keeps working without the island.One behaviour change in the poll loop: it used to stop at
progress >= 100or an end state.process_batch_upload()setsprogress = 100before it setsstatus, so a poll could catch a batch at 100% that was stillprocessing, and then it would stop. With the island that would leave a busy row at 100% forever. The poll now stops only oncompletedorfailed.How it was verified
New cases at the end of
tests/web/test_status_island.cjs. They run the realmonitorUploadProgress()/_reportUpload()fromapp.jsagainst the real island model (StatusIsland.createModel()). OnlyapiCall(returns theUploadStatusshape fromweb/api/documents.py) andsetTimeout(run by hand) are stubbed:{ fallback: 'notes.pdf' }, the right state, progress and key at each step; the confirmation has nosettleand leaves on expiry; polling stops and the history reloads once;processingat 100% is polled again and ends assuccess;errors[0], is dismissible, does not expire by itself, and goes away when closed; emptyerrorsfalls back toisland.upload.failed;upload-a,upload-b) with their own labels and percentages;statusIsland = null; every key used exists inen.json.tests/webin apython:3.12-slimcontainer (Node 20,pip install -e ".[dev]"):bash scripts/pr/pre_pr_check.sh(same container):Screenshots
The dashboard (
index.html,app.js,status-island.js,style.cssfrom this branch) in headless Chromium./apiwas answered by stubs and the import answers came through the realmonitorUploadProgress()poll. The stub has no event stream, so the connection row was set to "Connected" by hand. Panel open in every shot.Two imports running (
quarterly-report.pdfat 45%,team-handbook.mdat 80%):One import failed (stays, with Close), the other still running:
Changelog fragment
changelog.d/2004.added.mdNotes for the reviewer
island.upload.queued("Waiting to start"),island.upload.processing("Importing"),island.upload.completed("Imported"),island.upload.failed("Import failed"). None of the existing keys fit an import. I added all four to all eleven catalogs with translations, not English placeholders. A native speaker should check them.process_document_upload()leavesprogressat 0 until completion (only batches update it per file), so a single file showsbusyat 0% and then the confirmation. I kept the issue's mapping (progressfrom the answer) and did not change the backend. If you would rather show'unknown'while a single upload is at 0, or showchunks_processedin the text, that is a small follow-up.errors[0]as is, with no catalog key, as the issue asks. For a batch it starts with the file name, so the panel shows the name twice (see the failed screenshots).Agent Disclosure
This PR was generated by an AI coding agent (Claude Code, Anthropic). The submitting account is operated by Jils Shah (@jilsnshah).
Human review of this PR: none beyond the submitter asking for it. The code, tests and screenshots were produced and checked by the agent (results above). The submitter has not reviewed the diff line by line.


Confidence Score: 5/5
The PR appears safe to merge.Summary
Document imports now report progress in the shared status island.
No new actionable issues were found. The previous partial-import finding is fixed.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD Poll[Poll upload status] --> Report[Update the upload row] Report --> State{Upload status} State -->|Queued or processing| Wait[Wait and poll again] Wait --> Poll State -->|Completed without errors| Success[Show success then remove row] State -->|Failed or completed with errors| Error[Keep error until closed]Reviews (3) · Last reviewed commit: "Merge branch 'main' into feat/upload-sta..." · Reviewed by Greptile