@@ -210,8 +210,8 @@ async fn federation<D: TwinDB, R: RateLimiter>(
210210
211211 let dst: SessionID = ( & envelope. destination ) . into ( ) ;
212212
213- // fast- fail path: if requested and destination is not local, return error immediately
214- if has_fast_fail ( & envelope) && !data. switch . is_local ( & dst) . await {
213+ // fail-fast path: if requested and destination is not local, return error immediately
214+ if has_fail_fast ( & envelope) && !data. switch . is_local ( & dst) . await {
215215 // destination session doesn’t exist on this relay
216216 return Response :: builder ( )
217217 . status ( http:: StatusCode :: NOT_FOUND )
@@ -232,7 +232,7 @@ async fn federation<D: TwinDB, R: RateLimiter>(
232232/// Canonical tag is "fail-fast" (kebab-case). Matching is token-based (comma/whitespace
233233/// separated) and case-sensitive. No legacy aliases are supported.
234234#[ inline]
235- fn has_fast_fail ( envelope : & Envelope ) -> bool {
235+ pub ( crate ) fn has_fail_fast ( envelope : & Envelope ) -> bool {
236236 const TAG_FAIL_FAST : & str = "fail-fast" ;
237237
238238 let tags = match envelope. tags . as_deref ( ) {
@@ -452,9 +452,9 @@ impl<M: Metrics, D: TwinDB> Session<M, D> {
452452 // push message to the (relay.federation) queue
453453 return Ok ( self . federator . send ( & msg) . await ?) ;
454454 }
455- // fast- fail path: we confirmed that this is not an foreign message, and if it is fast- fail taged and destination session is not connected
455+ // fail-fast path: we confirmed that this is not an foreign message, and if it is fail-fast taged and destination session is not connected
456456 // then the peer must be offline, return error immediately
457- if has_fast_fail ( envelope) && !is_local {
457+ if has_fail_fast ( envelope) && !is_local {
458458 anyhow:: bail!( "destination offline" ) ;
459459 }
460460 // we don't return an error because when we return an error
0 commit comments