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.
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 toselectedFiles.The published SDK then reads each file fully as a data URL (
FileReader.readAsDataURLin@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.