refactor: isolate Nostr backup publishing transport

This commit is contained in:
2026-08-22 16:54:29 +02:00
parent 2a90343e7e
commit b258d86af7
3 changed files with 219 additions and 8 deletions
+2 -2
View File
@@ -23,10 +23,10 @@ export const defaultTransport = async (): Promise<BackupTransport> => {
const results = await Promise.allSettled(pool.publish(relays, event))
// one honest relay keeping the event is enough - addressable events
// are re-publishable, and the next debounced publish retries anyway
if (!results.some(r => r.status === 'fulfilled')) {
if (!results.some((r) => r.status === 'fulfilled')) {
throw new Error('No relay accepted the backup event.')
}
},
fetch: (relays, filter) => pool.querySync(relays, filter)
fetch: (relays, filter) => pool.querySync(relays, filter),
}
}