Skip to content

fix: use Blossom servers that accept encrypted chat attachments - #642

Merged
Catrya merged 1 commit into
mainfrom
fix/blossom-servers-encrypted-blobs
Aug 12, 2026
Merged

fix: use Blossom servers that accept encrypted chat attachments#642
Catrya merged 1 commit into
mainfrom
fix/blossom-servers-encrypted-blobs

Conversation

@AndreaDiazCorreia

@AndreaDiazCorreia AndreaDiazCorreia commented Aug 12, 2026

Copy link
Copy Markdown
Member

Problem

Chat and dispute attachments fail for every user. All nine configured Blossom servers reject the upload, so BlossomUploadHelper exhausts the list and throws All 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:

Server image/jpeg octet-stream
blossom.primal.net 200 415
blossom.band 201 415
nostr.media 200 400
24242.io 400 (already stored) 400

The 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 issues
  • flutter test: 485 passing
  • Round-trip verified against all five servers

Known limitations

  • Retention is unverified for four of the five servers; none publish a policy. Hosts with published expiration were excluded, but this remains a risk for dispute evidence and argues for a Mostro-operated server.
  • Only the server list changed. Pre-existing issues left untouched: BlossomClient builds the blob URL instead of using the one the server returns, and incoming blossom_url values are fetched automatically without host validation.

Summary by CodeRabbit

  • New Features

    • Added support for opaque encrypted chat attachments.
    • Blob storage is now documented as supporting indefinite retention.
  • Improvements

    • Updated the default Blossom server list to five hosts, providing a streamlined set of storage options:
      • cdn.hzrd149.com
      • nostr.download
      • blossom-01.uid.ovh
      • files.sovbit.host
      • blssm.us

… 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
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

BlossomConfig.defaultServers now contains five ordered Blossom hosts. Its documentation defines fallback order, encrypted attachment support, rejection of media-only hosts, and indefinite blob retention.

Changes

Blossom defaults

Layer / File(s) Summary
Update Blossom server defaults
lib/core/config/blossom_config.dart
The default server list changes from nine endpoints to five. The documentation specifies ordered fallback behavior, encrypted attachment support, media-only host rejection, and indefinite blob retention.

Estimated code review effort: 2 (Simple) | ~5 minutes

Poem

I’m a rabbit hopping through the host list bright,
Five Blossom servers now guide the night.
Encrypted files find a safe retreat,
Ordered fallbacks make the path complete.
Blobs stay stored, secure and sweet.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: replacing Blossom servers with servers that accept encrypted chat attachments.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/blossom-servers-encrypted-blobs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 35df574 and fb8e7e6.

📒 Files selected for processing (1)
  • lib/core/config/blossom_config.dart

Comment thread lib/core/config/blossom_config.dart

@ermeme ermeme Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --check passed.
  • 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.

@Catrya Catrya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

@Catrya
Catrya merged commit a0d4d6e into main Aug 12, 2026
2 checks passed
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.

2 participants