Skip to content

Customer chat: no client-side size or count limit before the SDK base64-encodes attachments #1376

Description

@marassteiner

Follow-up from #1297 (not a merge blocker). Pre-existing for the file picker; this PR also applies it to paste and drop.

Evidence

src/screens/chat.screen.tsx:420 (addFiles) checks only the file type. Any number and size of accepted files is appended to selectedFiles.

The published SDK then reads each file fully as a data URL (FileReader.readAsDataURL in @dfx.swiss/react / @dfx.swiss/core). A large PDF or screenshot can stall or crash a mobile tab before the API can reject it.

Suggested fix

Enforce the API’s per-file, per-batch, and count limits before setSelectedFiles, and show a localised, non-sendable error.

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