Skip to content

feat: resolve image/audio URLs using cloud base URL#2862

Merged
lifeart merged 5 commits into
masterfrom
feat/resolve-cloud-base-url
Mar 13, 2026
Merged

feat: resolve image/audio URLs using cloud base URL#2862
lifeart merged 5 commits into
masterfrom
feat/resolve-cloud-base-url

Conversation

@lifeart
Copy link
Copy Markdown
Collaborator

@lifeart lifeart commented Mar 13, 2026

Summary

  • Load S3 base URL from /api/cloud/baseFileUrl during app boot, login, and registration (in parallel via Promise.all)
  • urlForImage() and urlForAudio() now prepend the cloud base URL for paths starting with / (API-returned relative paths)
  • Local public/pictures/ assets (avatars, exercise-type icons, victory/regret images) are not affected — they continue to be served locally
  • Added .gitignore entries for ffmpeg build artifacts

Changed files

  • app/utils/file-url.ts — added setCloudBaseUrl/getCloudBaseUrl, updated urlForImage/urlForAudio to use cloud prefix
  • app/services/network.ts — added loadCloudUrl() method
  • app/routes/application.js — load cloud URL on app boot
  • app/components/login-form/index.gts — load cloud URL on login
  • app/components/registration-form/index.gts — load cloud URL on registration
  • tests/unit/utils/file-url-test.js — 12 tests covering all URL resolution scenarios

Test plan

  • Unit tests pass (12/12 for file-url)
  • Verify image/audio URLs resolve correctly with backend running
  • Verify local assets (avatars, exercise-type icons) still load from /pictures/

🤖 Generated with Claude Code

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>
@lifeart lifeart requested a review from ElenaSpb as a code owner March 13, 2026 14:02
lifeart and others added 3 commits March 13, 2026 14:05
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>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 13, 2026

Gradle Unit and Integration Test Results

523 tests  ±0   521 ✔️ ±0   38s ⏱️ -1s
116 suites ±0       2 💤 ±0 
116 files   ±0       0 ±0 

Results for commit 2488a3e. ± Comparison against base commit 6ac63ee.

♻️ This comment has been updated with latest results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Frontend test coverage: 71.47% (+0.18% compared to 71.29% on base)

@sonarqubecloud
Copy link
Copy Markdown

@lifeart lifeart merged commit 81636e9 into master Mar 13, 2026
10 checks passed
@lifeart lifeart deleted the feat/resolve-cloud-base-url branch March 13, 2026 14:53
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.

1 participant