Skip to content

PDF document upload can silently fail or show generic error #571

Description

@AnthonyRonning

Problem

PDF document upload can appear to do nothing after a user selects a file, while image upload continues to work.

The current chat document upload path has a couple of UX/failure cases that can look like the document never attached:

  • UnifiedChat.tsx checks file extensions case-sensitively, e.g. file.name.endsWith(".pdf"). Files named .PDF can pass the picker but miss all document-processing branches.
  • If PDF extraction returns no usable text, the UI does not attach the document and may only show a generic Failed to process document message, depending on where the failure occurs.
  • Support docs say PDFs must be text-based and under 10MB, but the app does not clearly surface that distinction to the user at selection time.

Suggested investigation/fix

  • Normalize selected document filenames before extension checks (toLowerCase() or MIME/type-based handling).
  • Add an explicit unsupported-document branch so valid-looking picker selections cannot no-op.
  • Surface a more specific error when PDF text extraction fails or returns empty text, especially for scanned/image-only PDFs.
  • Confirm behavior on current macOS desktop, iOS, and Android builds with:
    • lowercase .pdf
    • uppercase .PDF
    • text-based PDF under 10MB
    • scanned/image-only PDF under 10MB
    • PDF over 10MB

Relevant code

  • frontend/src/components/UnifiedChat.tsx: handleDocumentUpload
  • frontend/src-tauri/src/pdf_extractor.rs: extract_document_content
  • docs/support-faq.md: file upload support guidance

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions