fix(control-plane): show pending uploaded documents (server-driven)#2420
Merged
Conversation
…tions Render in-flight and failed file uploads in the Documents view by deriving them from the server's file_convert_retain operations — no client-side store or client-generated document ids. - surface document_id + original_filename on the operations list endpoint (already stored in the operation's result_metadata) - documents-view derives pending/failed rows from those operations, deduped against the real document list by document_id, and polls while in-flight - bridge the brief window where an operation reports completed before the document becomes visible in listDocuments, so the row never flickers Supersedes #2346 (client-side sessionStorage approach). Closes #2314.
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.
Summary
Show in-flight and failed file uploads in the control-plane Documents view, so an uploaded file appears immediately (as a
Processingrow) instead of silently vanishing until conversion + extraction finish.This is a server-driven reimplementation of #2346. That PR tracked pending uploads client-side (a
sessionStoragestore + client-generated document ids). Here the source of truth is the server'sfile_convert_retainoperations, so the status survives reloads, tabs and devices, and there's no client-side id generation.Closes #2314.
Supersedes #2346.
How it works
result_metadataonto the operations list endpoint:document_id(was hard-codednullinlist_operations)filename(new field onOperationResponse, fromoriginal_filename)file_convert_retainoperations, deduplicated against the real document list bydocument_id, and polls while any upload is in flight.file_convert_retainoperation reportscompleteda couple of seconds before the document becomes visible inlistDocuments. The pending row is kept for recently-completed operations and removed only when the real document row appears (dedup bydocument_id), so the row stays on screen continuously rather than blinking out and back.No new table, no schema migration, no client-side store, no client-generated ids.
Tests
test_list_operations_surfaces_file_document_id_and_filename— assertslist_operationsround-tripsdocument_id+filenameforfile_convert_retainoperations.filenamefield../scripts/hooks/lint.shclean.