Default to no fallbacks

This commit is contained in:
Jon Staab
2025-04-07 16:53:53 -07:00
parent 7cb8033334
commit d0d727edd1
+3 -4
View File
@@ -235,14 +235,13 @@ export class Router {
FromUser = () => this.FromRelays(this.getRelaysForUser(RelayMode.Write)) FromUser = () => this.FromRelays(this.getRelaysForUser(RelayMode.Write))
UserInbox = () => this.FromRelays(this.getRelaysForUser(RelayMode.Inbox)).policy(addNoFallbacks) UserInbox = () => this.FromRelays(this.getRelaysForUser(RelayMode.Inbox))
ForPubkey = (pubkey: string) => this.FromRelays(this.getRelaysForPubkey(pubkey, RelayMode.Read)) ForPubkey = (pubkey: string) => this.FromRelays(this.getRelaysForPubkey(pubkey, RelayMode.Read))
FromPubkey = (pubkey: string) => this.FromRelays(this.getRelaysForPubkey(pubkey, RelayMode.Write)) FromPubkey = (pubkey: string) => this.FromRelays(this.getRelaysForPubkey(pubkey, RelayMode.Write))
PubkeyInbox = (pubkey: string) => PubkeyInbox = (pubkey: string) => this.FromRelays(this.getRelaysForPubkey(pubkey, RelayMode.Inbox))
this.FromRelays(this.getRelaysForPubkey(pubkey, RelayMode.Inbox)).policy(addNoFallbacks)
ForPubkeys = (pubkeys: string[]) => this.merge(pubkeys.map(pubkey => this.ForPubkey(pubkey))) ForPubkeys = (pubkeys: string[]) => this.merge(pubkeys.map(pubkey => this.ForPubkey(pubkey)))
@@ -361,7 +360,7 @@ export class RouterScenario {
weight = (scale: number) => weight = (scale: number) =>
this.update(selection => ({...selection, weight: selection.weight * scale})) this.update(selection => ({...selection, weight: selection.weight * scale}))
getPolicy = () => this.options.policy || addMaximalFallbacks getPolicy = () => this.options.policy || addNoFallbacks
getLimit = () => this.options.limit || this.router.options.getLimit?.() || 3 getLimit = () => this.options.limit || this.router.options.getLimit?.() || 3