This repository has no description
0

Configure Feed

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

feat: add some debug logging

+7
+2
messages.go
··· 19 19 return fmt.Errorf("could not determine who to send the notification to: %w", err) 20 20 } 21 21 22 + ll.Debug("Sending notification for %s on %s to %d users: %v", msg.Event, msg.ChurrosObjectId, len(users), users) 23 + 22 24 subs, err := subscriptionsOfUsers(users) 23 25 if err != nil { 24 26 return fmt.Errorf("could not determine which subscriptions to send the notification to: %w", err)
+3
subscriptions.go
··· 6 6 7 7 "git.inpt.fr/churros/notella/db" 8 8 "github.com/SherClockHolmes/webpush-go" 9 + ll "github.com/gwennlbh/label-logger-go" 9 10 ) 10 11 11 12 type SubscriptionOwner struct { ··· 49 50 }, 50 51 }) 51 52 } 53 + 54 + ll.Debug("Found %d subscriptions for %d users %v", len(subscriptions), len(ids), ids) 52 55 53 56 return subscriptions, nil 54 57 }
+2
users.go
··· 5 5 "fmt" 6 6 7 7 "git.inpt.fr/churros/notella/db" 8 + ll "github.com/gwennlbh/label-logger-go" 8 9 ) 9 10 10 11 // AllUsers returns all the users in the database that have at least one notification subscription ··· 31 32 32 33 // Receivers determines which users to send the notification to 33 34 func Receivers(message Message) ([]string, error) { 35 + ll.Debug("Determining receivers for message %s on %s", message.Event, message.ChurrosObjectId) 34 36 switch message.Event { 35 37 case EventNewPost: 36 38 return receiversForPost(message)