this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

handle nil fields

+11 -6
+3 -1
cmd/relayered/relay/account.go
··· 160 160 161 161 // Do a trivial API request against the PDS to verify that it exists 162 162 pclient := &xrpc.Client{Host: durl.String()} 163 - r.Config.ApplyPDSClientSettings(pclient) 163 + if r.Config.ApplyPDSClientSettings != nil { 164 + r.Config.ApplyPDSClientSettings(pclient) 165 + } 164 166 cfg, err := comatproto.ServerDescribeServer(ctx, pclient) 165 167 if err != nil { 166 168 // TODO: failing this shouldn't halt our indexing
+5 -5
cmd/relayered/relay/validator/validator.go
··· 406 406 xdid, err := syntax.ParseDID(commit.DID) 407 407 if err != nil { 408 408 commitVerifyErrors.WithLabelValues(hostname, "sig1").Inc() 409 - return fmt.Errorf("bad car DID, %w", err) 409 + return fmt.Errorf("bad car DID: %w", err) 410 410 } 411 411 ident, err := val.directory.LookupDID(ctx, xdid) 412 412 if err != nil { ··· 419 419 return nil 420 420 } 421 421 commitVerifyErrors.WithLabelValues(hostname, "sig2").Inc() 422 - return fmt.Errorf("DID lookup failed, %w", err) 422 + return fmt.Errorf("DID lookup failed: %w", err) 423 423 } 424 - pk, err := ident.GetPublicKey("atproto") 424 + pk, err := ident.PublicKey() 425 425 if err != nil { 426 426 commitVerifyErrors.WithLabelValues(hostname, "sig3").Inc() 427 - return fmt.Errorf("no atproto pubkey, %w", err) 427 + return fmt.Errorf("no atproto pubkey: %w", err) 428 428 } 429 429 err = commit.VerifySignature(pk) 430 430 if err != nil { 431 431 // TODO: if the DID document was stale, force re-fetch from source and re-try if pubkey has changed 432 432 commitVerifyErrors.WithLabelValues(hostname, "sig4").Inc() 433 - return fmt.Errorf("invalid signature, %w", err) 433 + return fmt.Errorf("invalid signature: %w", err) 434 434 } 435 435 return nil 436 436 }
+3
cmd/relayered/stream/persist/diskpersist/diskpersist.go
··· 658 658 return uid, nil 659 659 } 660 660 661 + if dp.uids == nil { 662 + return 0, fmt.Errorf("DiskPersistence has no UID resolver registered") 663 + } 661 664 uid, err := dp.uids.DidToUid(ctx, did) 662 665 if err != nil { 663 666 return 0, err