fix(web): materialize Android picker images on selection - #122
Conversation
84ac38e to
7507c76
Compare
oleksoleksoleks
left a comment
There was a problem hiding this comment.
Two merge blockers:
-
Pending materialization can revive a deleted session.
disposeSessionclears current attachments, but an already queuedFileReaderlater callsaddAttachments(sessionId, result.accepted), recreating hidden state and preview URLs with no disposal path. Invalidate pending intake with a session lifetime token before admission. -
Concurrent picker/paste/drop batches bypass the global staging cap because each snapshots only admitted attachments before allocating every
FileReaderbuffer. Reserve byte/count capacity before materialization, or serialize all intake so pending batches count toward the cap.
Applicable CI is green, but these lifecycle and bounded-memory invariants need tests and fixes before merge.
|
Thanks for the PR. I added a small follow-up:
|
|
Implemented session-lifetime invalidation and serialized global attachment intake, rebased the complete contribution onto current main, and opened #133 as the replacement. Web typecheck and all 1,219 tests pass. Please close this superseded branch. |
Summary
Filefor previews and later uploadReproduction
On a Samsung Android device, selecting a valid JPEG through the system Photo Picker produced a transient content-provider
File. The attachment chip could be created from its metadata, but the later upload read failed withNotReadableError, surfacing:The file was a valid baseline JPEG; the failure was the lifetime of the picker-backed
File, not.jpgformat support.Verification
pnpm checkpnpm testFileReaderstarts synchronously, bypasses a later-failing sourcearrayBuffer(), and stages a distinct byte-backed JPEGFile