Skip to content

fix(frontend): fall back to blob url when FileReader is unavailable - #3736

Merged
kolaente merged 1 commit into
mainfrom
fix-filereader-fallback
Sep 4, 2026
Merged

fix(frontend): fall back to blob url when FileReader is unavailable#3736
kolaente merged 1 commit into
mainfrom
fix-filereader-fallback

Conversation

@tink-bot

@tink-bot tink-bot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

SVG attachment preview did new FileReader() unconditionally. Some iOS environments strip FileReader (Lockdown Mode, embedded webviews), so whole promise rejected unhandled — Sentry FRONTEND-OSS-2DW, ~106 events on iOS 18 Mobile Safari. Now SVG path only take data-url route when FileReader exist, else fall back to blob url like every other mime type.

How to verify

  1. Attach an SVG file to a task and open the task detail view.
  2. Click the attachment to open the preview.
  3. Expected: the SVG renders in the preview.
  4. In devtools, run window.FileReader = undefined, reload the page, and open the SVG attachment again.
  5. Expected: the SVG still renders and no unhandled rejection appears in the console.
  6. Before this PR: step 5 threw ReferenceError: Can't find variable: FileReader.

@github-actions github-actions Bot added area/attachments File attachments on tasks: upload, preview, download area/frontend Frontend-only code or UI work labels Sep 4, 2026
@kolaente
kolaente enabled auto-merge (rebase) September 4, 2026 21:01
@github-actions github-actions Bot added the auto-merge PR has GitHub auto-merge enabled label Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Preview Deployment

Preview deployments for this PR are available at:

URL Tag Commit
https://pr-3736.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:pr-3736 latest
https://sha-dccd87e3f36f635324c7654eac247b1f84143427.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-dccd87e3f36f635324c7654eac247b1f84143427 dccd87e

The preview environment will start automatically on first visit. Subsequent pushes to this PR will update the pr-3736 image — the preview picks up the new version on restart. The per-commit URLs point to a specific version and will not change.

Run locally with Docker
docker pull ghcr.io/go-vikunja/vikunja:pr-3736
docker run -p 3456:3456 ghcr.io/go-vikunja/vikunja:pr-3736

Last updated for commit dccd87e

@kolaente
kolaente merged commit 595dc9e into main Sep 4, 2026
45 checks passed
@kolaente
kolaente deleted the fix-filereader-fallback branch September 4, 2026 21:32
@github-actions github-actions Bot removed the auto-merge PR has GitHub auto-merge enabled label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/attachments File attachments on tasks: upload, preview, download area/frontend Frontend-only code or UI work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants