Expand description
BUD-03 user blossom server list (kind 10063) — store, merge, publish, fetch.
Two SQL settings rows back the user’s preferences:
custom_blossom_servers—Vec<CustomBlossomServer>JSONdisabled_default_blossom_servers—Vec<String>JSON
Resolution order (BUD-03 trust order): enabled defaults, then enabled customs.
Structs§
- Blossom
Server Info - One row in the frontend’s Media Servers list.
- Custom
Blossom Server
Constants§
- DEFAULT_
BLOSSOM_ SERVERS - Default servers in trust order (first = first try). All verified to accept Vector’s encrypted octet-stream uploads at common sizes.
Functions§
- compute_
enabled_ servers - fetch_
and_ merge_ own_ list - Fetch our latest kind 10063 and reconcile: append unknown customs,
follow the originating device’s default enable/disable choices.
sessiongates writes against a mid-fetch account swap. - is_
default_ server - is_
enabled_ server - Race-guard for in-flight probes: true if
urlis in the currently enabled list at this moment. - list_
all_ servers - All rows for the frontend (defaults then customs, including disabled).
- load_
custom_ blossom_ servers - load_
disabled_ default_ blossom_ servers - merge_
urls_ into_ customs - Pure merge: append novel URLs from
incoming(validated, normalized) intocustomsas enabled. Existing rows are never removed or reordered. - publish_
blossom_ servers - Publish the resolved enabled list (defaults + customs, in trust order) as a BUD-03 kind 10063 replaceable event. Peers using our list as a fallback need to see every server we use, not just the customs.
- refresh_
cache - Refresh the in-memory
BLOSSOM_SERVERScache. Call after edits + on login. - republish_
blossom_ servers_ debounced - Debounced republish: rapid edits coalesce; mid-window session swap aborts.
Retries once on failure (5s backoff): a stale event on the network would
otherwise let
fetch_and_merge_own_listoverwrite the local prefs on the next boot. - save_
custom_ blossom_ servers - save_
disabled_ default_ blossom_ servers - validate_
url - Validate + canonicalize a server URL: trim, strip trailing slash,
auto-prefix
https://on bare domains, enforce http(s) + non-empty host.