Add downloadIfMissing parameter to media GetFileStream APIs. - #2459
Conversation
Let callers opt out of implicit remote downloads so the media manager can preview only locally cached files, while entry-editor callers still auto-fetch by passing true explicitly from JS. Co-authored-by: Cursor <cursoragent@cursor.com>
📝 WalkthroughWalkthroughChangesThe media stream APIs now accept a Media download control
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs (1)
1960-1967: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftHonor the new
downloadIfMissingcontract.The parameter is accepted but ignored, so
downloadIfMissing=truestill returnsNotFoundfor uncached files. This conflicts withIMiniLcmReadApiandLcmMediaService, wheretruepermits downloading missing media. Implement the download path for this backend, or explicitly make this implementation cache-only and prevent callers from relying on the default behavior.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs` around lines 1960 - 1967, The GetFileStream method ignores downloadIfMissing; implement its true-path behavior to retrieve missing media consistently with IMiniLcmReadApi and LcmMediaService, while retaining cached-file reads. If this backend cannot download media, explicitly enforce cache-only semantics and ensure callers cannot rely on the default true value.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs`:
- Around line 1960-1967: The GetFileStream method ignores downloadIfMissing;
implement its true-path behavior to retrieve missing media consistently with
IMiniLcmReadApi and LcmMediaService, while retaining cached-file reads. If this
backend cannot download media, explicitly enforce cache-only semantics and
ensure callers cannot rely on the default true value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 96efefd3-e29c-4c84-89ab-e11cf4116202
📒 Files selected for processing (13)
backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.csbackend/FwLite/FwLiteShared/Services/MediaFilesServiceJsInvokable.csbackend/FwLite/FwLiteShared/Services/MiniLcmJsInvokable.csbackend/FwLite/LcmCrdt/CrdtMiniLcmApi.csbackend/FwLite/LcmCrdt/MediaServer/LcmMediaService.csbackend/FwLite/MiniLcm/IMiniLcmReadApi.csfrontend/viewer/src/lib/components/field-editors/audio-input.sveltefrontend/viewer/src/lib/dotnet-types/generated-types/FwLiteShared/Services/IMediaFilesServiceJsInvokable.tsfrontend/viewer/src/lib/dotnet-types/generated-types/FwLiteShared/Services/IMiniLcmJsInvokable.tsfrontend/viewer/src/lib/entry-editor/field-editors/EditPictureDialog.sveltefrontend/viewer/src/lib/entry-editor/field-editors/PictureImage.sveltefrontend/viewer/src/lib/media-manager/MediaFileDetail.sveltefrontend/viewer/src/project/demo/in-memory-demo-api.ts
Let callers opt out of implicit remote downloads so the media manager can preview only locally cached files, while entry-editor callers still auto-fetch by passing true explicitly from JS.
This is required for the picture UI to show a load button.