feat: resolve image/audio URLs using cloud base URL#2862
Merged
Conversation
Load the S3 base URL from /api/cloud/baseFileUrl during app init, login, and registration. Use it to prefix relative image and audio paths (starting with '/') so assets resolve to the correct S3 bucket. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add `picture` getter to exercise/subgroup schemas that resolves `pictureUrl` through `urlForImage()`. Skip cloud resolution for paths starting with `/public/` (local assets). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Resolve noiseUrl through urlForAudio in exercise schema - Add error handling to loadCloudUrl (non-critical, fails gracefully) - Add /public/ skip to urlForAudio for consistency with urlForImage - Fix urlForImage to return /-prefixed paths as-is when no cloud URL Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…service Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Frontend test coverage: 71.47% (+0.18% compared to 71.29% on base) |
|
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
/api/cloud/baseFileUrlduring app boot, login, and registration (in parallel viaPromise.all)urlForImage()andurlForAudio()now prepend the cloud base URL for paths starting with/(API-returned relative paths)public/pictures/assets (avatars, exercise-type icons, victory/regret images) are not affected — they continue to be served locally.gitignoreentries for ffmpeg build artifactsChanged files
app/utils/file-url.ts— addedsetCloudBaseUrl/getCloudBaseUrl, updatedurlForImage/urlForAudioto use cloud prefixapp/services/network.ts— addedloadCloudUrl()methodapp/routes/application.js— load cloud URL on app bootapp/components/login-form/index.gts— load cloud URL on loginapp/components/registration-form/index.gts— load cloud URL on registrationtests/unit/utils/file-url-test.js— 12 tests covering all URL resolution scenariosTest plan
/pictures/🤖 Generated with Claude Code