fix(app): accept unnamed Android IME image paste files - #1193
Open
salemsayed wants to merge 1 commit into
Open
Conversation
salemsayed
marked this pull request as ready for review
August 8, 2026 10:23
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
File.namelastModified, while leaving already-named files unchangedRoot cause
This was reproduced end to end in the installed bb WebAPK on an Oppo Pad Mini running Android 16 and Chrome 150.
There are two browser/application stages:
contentMimeTypes=null; Gboard stops before the page receives an event and displays “Chrome does not support image pasting here.” Web code cannot handle an event that Chrome does not emit.contentMimeTypes=[image/*]and Gboard dispatches a normalpasteevent. Its clipboard payload contains one validimage/pngfile, but the filename is the empty string.PromptBoxInternalforwarded that file unchanged, and the SDK rejected it withProject attachment filename must not be empty.This is not caused by the PWA manifest or standalone display mode. The WebAPK runs through Chrome's regular editor/input connection; the PWA simply exposed the same unnamed-file payload to bb's existing paste handler.
Fix
Normalize only pasted files whose names are empty or whitespace. Images receive a stable
pasted-imagename and a MIME-derived extension (for example,pasted-image.png). Additional files receive numbered names. Existing filenames are preserved.The live production upload path was also exercised with the equivalent normalization: Gboard's unnamed 11.7 KB PNG became
pasted-image.png, uploaded successfully, and rendered in the composer.Validation
pnpm exec turbo run test --filter=@bb/app --force— 323 files / 2,431 tests passedpnpm exec turbo run typecheck --filter=@bb/app— passedpnpm exec turbo run lint --filter=@bb/app— passed with 0 errors (141 existing warnings)