0

Upgrade versions of vendored libs

This commit is contained in:
eleksir
2023-05-18 23:55:10 +03:00
parent 4869c146fe
commit 7958db9c0d
555 changed files with 36170 additions and 15565 deletions

View File

@@ -31,7 +31,6 @@ type Scope struct {
extra map[string]interface{}
fingerprint []string
level Level
transaction string
request *http.Request
// requestBody holds a reference to the original request.Body.
requestBody interface {
@@ -275,22 +274,6 @@ func (scope *Scope) SetLevel(level Level) {
scope.level = level
}
// SetTransaction sets the transaction name for the current transaction.
func (scope *Scope) SetTransaction(name string) {
scope.mu.Lock()
defer scope.mu.Unlock()
scope.transaction = name
}
// Transaction returns the transaction name for the current transaction.
func (scope *Scope) Transaction() (name string) {
scope.mu.RLock()
defer scope.mu.RUnlock()
return scope.transaction
}
// Clone returns a copy of the current scope with all data copied over.
func (scope *Scope) Clone() *Scope {
scope.mu.RLock()
@@ -312,7 +295,6 @@ func (scope *Scope) Clone() *Scope {
clone.fingerprint = make([]string, len(scope.fingerprint))
copy(clone.fingerprint, scope.fingerprint)
clone.level = scope.level
clone.transaction = scope.transaction
clone.request = scope.request
clone.requestBody = scope.requestBody
clone.eventProcessors = scope.eventProcessors
@@ -365,7 +347,11 @@ func (scope *Scope) ApplyToEvent(event *Event, hint *EventHint) *Event {
// to link errors and traces/spans in Sentry.
continue
}
event.Contexts[key] = value
// Ensure we are not overwriting event fields
if _, ok := event.Contexts[key]; !ok {
event.Contexts[key] = value
}
}
}
@@ -379,8 +365,7 @@ func (scope *Scope) ApplyToEvent(event *Event, hint *EventHint) *Event {
}
}
var emptyUser User
if event.User == emptyUser {
if event.User.IsEmpty() {
event.User = scope.user
}
@@ -392,10 +377,6 @@ func (scope *Scope) ApplyToEvent(event *Event, hint *EventHint) *Event {
event.Level = scope.level
}
if scope.transaction != "" {
event.Transaction = scope.transaction
}
if event.Request == nil && scope.request != nil {
event.Request = NewRequest(scope.request)
// NOTE: The SDK does not attempt to send partial request body data.