Skip to content

fix(images): encode the source handed to a media element - #26

Merged
skjnldsv merged 1 commit into
mainfrom
fix/encoded-source
Sep 10, 2026
Merged

fix(images): encode the source handed to a media element#26
skjnldsv merged 1 commit into
mainfrom
fix/encoded-source

Conversation

@skjnldsv

Copy link
Copy Markdown
Contributor

useViewerProps builds an encoded source so that "special characters in the name don't break the media element's src URL", and three places went around it and used file.source directly: the image element for a file with no preview (Images.vue), the video element of a live photo, and the editor's src (ImageEditor.vue, whose save request already used encodedSource).

A name holding a # cuts the URL short there:

RAW https://cloud.example.com/remote.php/dav/files/admin/a#b c?.jpg
ENC https://cloud.example.com/remote.php/dav/files/admin/a%23b%20c%3F.jpg

The image then fails to load and falls back to a hand fetch; the live photo and the editor just stay empty.

Four tests, all failing before: the getPreviewIfAny() fallback, the image element, the live-photo video element, and the editor's src. mediaPreloader still passes file.source to the webdav client, which encodes it itself, so that one is left alone.

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

@skjnldsv skjnldsv added status: review Waiting for reviews type: bug 🐛 Something isn't working AI assisted labels Sep 10, 2026
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.91%. Comparing base (d2d8ebf) to head (53efccb).

Files with missing lines Patch % Lines
lib/components/Images.vue 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #26   +/-   ##
=======================================
  Coverage   84.91%   84.91%           
=======================================
  Files          36       36           
  Lines        2460     2460           
  Branches      501      502    +1     
=======================================
  Hits         2089     2089           
  Misses        368      368           
  Partials        3        3           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

`useViewerProps` builds an encoded source for exactly this reason, and
three places went around it: the image element for a file with no
preview, the video element of a live photo, and the editor's own `src`.
A name holding a `#` cuts the URL short there and the file fails to
load; the fallback of the first is a hand fetch, the other two just
stay empty.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv
skjnldsv merged commit a86decd into main Sep 10, 2026
17 of 18 checks passed
@skjnldsv
skjnldsv deleted the fix/encoded-source branch September 10, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted status: review Waiting for reviews type: bug 🐛 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant