Skip to content

fix(smart-input): revoke compress object URL; skip non-image previews - #118

Merged
shreechaturvedi merged 2 commits into
mainfrom
fix/104-smart-input-image-compress-leak
Aug 3, 2026
Merged

shreechaturvedi merged 2 commits into
mainfrom
fix/104-smart-input-image-compress-leak

Conversation

@shreechaturvedi

Copy link
Copy Markdown
Owner

Summary

  • Revoke the temporary createObjectURL used by image compression in a try/finally so large attachments no longer leak blob URLs.
  • Build data-URL previews only for image/* files so PDFs/videos are not base64-encoded into memory.
  • Extract helpers to lib/attachmentPreview.ts with unit coverage for revoke-on-success, revoke-on-error, and non-image skip.

Closes #104.

Test plan

  • npm run lint
  • Unit tests in EnhancedTaskInput.filePreview.test.ts (8)
  • Backend mocked suite
  • npm run build
  • CI green on PR

compressImageIfNeeded leaked a blob URL per large image (createObjectURL
never revoked). Move helpers to lib/attachmentPreview and always revoke
in try/finally. Gate data-URL previews to image/* so PDFs/videos are not
base64-encoded into memory. Closes #104.
…skip

Skipping preview base64 for non-images (#104) left TaskFocusPane
mapping url to empty, so /api/upload never ran and the #35 503 toast
regressed. Resolve File→data URL at submit when preview is absent.
@shreechaturvedi
shreechaturvedi merged commit abc8a1d into main Aug 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smart-input: revoke image-compression object URL + skip base64 for non-images

1 participant