Skip to content
This repository was archived by the owner on Nov 25, 2024. It is now read-only.

Commit c6eb791

Browse files
committed
Add missing Clone, fix comments
1 parent 0d68e49 commit c6eb791

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Diff for: federationapi/routing/routing.go

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

Diff for: internal/httputil/httpapi.go

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

Diff for: relayapi/routing/routing.go

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

0 commit comments

Comments
 (0)