<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->
### Description
<!-- Please include a summary of the change. Please also include
relevant motivation and context. List any dependencies that are required
for this change. -->
Fixes #
#### Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
### AI disclosure:
- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
A media file larger than MAX_CACHE_BYTES was written to disk and then
immediately evicted by evict_if_needed (it alone exceeded the budget, so
everything — including itself — got dropped), so it was never servable
from disk on a hit.
ensure_cached now skips the write for bodies larger than the budget and
returns them in-memory for that request; handle_request serves a Range
request off the in-memory buffer via the new serve_range_memory. Cache
hits and all files within the budget are unchanged.
Make useRenderableMediaUrl idempotent under Tauri: it now rewrites
raw authenticated-media https URLs to sable-media:// even when the
caller bypassed the mxcUrlToHttp wrapper. This fixes 401 errors for
avatars from ~10 call sites (sidebar spaces, member tiles, reaction
viewer, etc.) that use the raw SDK method directly.
- Extract rewriteAuthenticatedMediaUrl helper in matrix.ts
- Apply it in useRenderableMediaUrl Tauri fast-path
- Use it from mxcUrlToHttp wrapper (single source)
- Add tests for both the helper and hook Tauri paths