Skip to content

fix(control-plane): show pending uploaded documents (server-driven)#2420

Merged
nicoloboschi merged 1 commit into
mainfrom
feat/server-side-pending-documents
Jun 26, 2026
Merged

fix(control-plane): show pending uploaded documents (server-driven)#2420
nicoloboschi merged 1 commit into
mainfrom
feat/server-side-pending-documents

Conversation

@nicoloboschi

Copy link
Copy Markdown
Collaborator

Summary

Show in-flight and failed file uploads in the control-plane Documents view, so an uploaded file appears immediately (as a Processing row) instead of silently vanishing until conversion + extraction finish.

This is a server-driven reimplementation of #2346. That PR tracked pending uploads client-side (a sessionStorage store + client-generated document ids). Here the source of truth is the server's file_convert_retain operations, so the status survives reloads, tabs and devices, and there's no client-side id generation.

Closes #2314.
Supersedes #2346.

How it works

  • Server surfaces two fields that were already stored in the operation's result_metadata onto the operations list endpoint:
    • document_id (was hard-coded null in list_operations)
    • filename (new field on OperationResponse, from original_filename)
  • Documents view derives pending/failed rows from file_convert_retain operations, deduplicated against the real document list by document_id, and polls while any upload is in flight.
  • No flicker: a file_convert_retain operation reports completed a couple of seconds before the document becomes visible in listDocuments. The pending row is kept for recently-completed operations and removed only when the real document row appears (dedup by document_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 — asserts list_operations round-trips document_id + filename for file_convert_retain operations.
  • Regenerated OpenAPI spec + Python/TypeScript/Go/Rust clients + docs skill for the new filename field.
  • ./scripts/hooks/lint.sh clean.

…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.
@nicoloboschi nicoloboschi merged commit 91e095a into main Jun 26, 2026
93 of 101 checks passed
@nicoloboschi nicoloboschi deleted the feat/server-side-pending-documents branch June 26, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uploaded documents show in list while being retained

1 participant