Add missing Clone, fix comments

This commit is contained in:
Till Faelligen 2024-01-18 08:18:26 +01:00
parent 0d68e49ac8
commit c6eb79133c
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E
3 changed files with 4 additions and 2 deletions

View file

@ -647,6 +647,8 @@ func MakeFedAPI(
// add the user to Sentry, if enabled
hub := sentry.GetHubFromContext(req.Context())
if hub != nil {
// clone the hub, so we don't send garbage events with e.g. mismatching rooms/event_ids
hub = hub.Clone()
hub.Scope().SetTag("origin", string(fedReq.Origin()))
hub.Scope().SetTag("uri", fedReq.RequestURI())
}

View file

@ -76,7 +76,7 @@ func MakeAuthAPI(
// add the user to Sentry, if enabled
hub := sentry.GetHubFromContext(req.Context())
if hub != nil {
// clone the hub, so we don't sent garbage events with e.g. mismatching rooms/event_ids
// clone the hub, so we don't send garbage events with e.g. mismatching rooms/event_ids
hub = hub.Clone()
hub.Scope().SetUser(sentry.User{
Username: device.UserID,

View file

@ -108,7 +108,7 @@ func MakeRelayAPI(
// add the user to Sentry, if enabled
hub := sentry.GetHubFromContext(req.Context())
if hub != nil {
// clone the hub, so we don't sent garbage events with e.g. mismatching rooms/event_ids
// clone the hub, so we don't send garbage events with e.g. mismatching rooms/event_ids
hub = hub.Clone()
hub.Scope().SetTag("origin", string(fedReq.Origin()))
hub.Scope().SetTag("uri", fedReq.RequestURI())