fix: use Blossom servers that accept encrypted chat attachments - #642
Conversation
… and retain blobs indefinitely - Replace media-only servers (primal, band, nostr.media, etc.) with general-purpose blob hosts - Add documentation explaining encrypted attachments are sent as application/octet-stream - Note that media-only servers reject opaque blobs via content sniffing - Require indefinite retention to prevent dispute evidence from expiring - New server list: cdn.hzrd149.com, nostr.download, blossom-01.uid.ovh, files.sovbit.host, blssm.us
Walkthrough
ChangesBlossom defaults
Estimated code review effort: 2 (Simple) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@lib/core/config/blossom_config.dart`:
- Around line 13-20: Update the defaultServers list to include only hosts whose
operators explicitly document indefinite blob retention suitable for dispute
evidence; remove any host lacking that documented policy, and preserve only
verifiably compliant defaults.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 43856008-8963-4adf-ab1d-42bc5d3d1f52
📒 Files selected for processing (1)
lib/core/config/blossom_config.dart
There was a problem hiding this comment.
Reviewed the current head fb8e7e6. I agree this is a valid production fix: the encrypted chat/dispute attachment path uploads opaque application/octet-stream blobs, and replacing media-sniffing hosts with servers that currently accept generic blobs removes the immediate all-host failure without changing upload logic.
Verified:
- Current GitHub build check is green.
- Local
git diff --checkpassed. - Reviewed the only changed file plus the upload client/helper path that sends the configured server list and MIME type.
- Re-read the active CodeRabbit retention-policy thread. I do not consider it a blocker for this PR because the PR body already states that long-term retention is not documented for most public hosts and calls out the operational follow-up / Mostro-operated server need; requiring only operators with explicit indefinite-retention policies would leave no usable default host set and keep the current upload outage.
No blocking issues found.
Problem
Chat and dispute attachments fail for every user. All nine configured Blossom servers reject the upload, so
BlossomUploadHelperexhausts the list and throwsAll Blossom servers failed.Root cause
Attachments are encrypted before upload, so they are sent as that reject opaque blobs. Encrypted data has no file signature, so content sniffing cannot classify it either — these servers could never have accepted our uploads.
Verified by uploading the same JPEG twice, changing only
Content-Type:image/jpegoctet-streamThe remaining five are down, whitelist-restricted, or misconfigured.
This was never working. The server list has not changed since the feature was added in #367, and the upload path is fully mocked in
file_messaging_test.dart, so CI could not catch the mismatch.Fix
Replace the list with servers that accept opaque blobs, sourced from the kind 36363 community directory and verified individually. Each one was tested with a 3 MB blob: upload succeeds,
GET {server}/{sha256}returns byte-identical data, and the URL scheme the client builds resolves.Adds a comment documenting both selection criteria so media-only servers are not reintroduced.
Verification
flutter analyze: no issuesflutter test: 485 passingKnown limitations
BlossomClientbuilds the blob URL instead of using the one the server returns, and incomingblossom_urlvalues are fetched automatically without host validation.Summary by CodeRabbit
New Features
Improvements