We could potentially set more stuff here. There are lots of scope properties that never change and which we currently set on the scope every time we capture an event. These are all candidates, I think:
|
Contexts.CopyTo(other.Contexts); |
|
Request.CopyTo(other.Request); |
|
User.CopyTo(other.User); |
|
|
|
other.Release ??= Release; |
|
other.Distribution ??= Distribution; |
|
other.Environment ??= Environment; |
|
other.TransactionName ??= TransactionName; |
|
other.Level ??= Level; |
|
|
|
if (Sdk.Name is not null && Sdk.Version is not null) |
|
{ |
|
other.Sdk.Name = Sdk.Name; |
|
other.Sdk.Version = Sdk.Version; |
|
} |
|
|
|
foreach (var package in Sdk.InternalPackages) |
|
{ |
|
other.Sdk.AddPackage(package); |
|
} |
More of a performance improvement but might result in a subtle behavioural change for some users (perhaps code that checks/expects things to not be set in certain circumstances and sets them conditionally on this basis ). To be safe, perhaps we delay a change like that until the next major release.
Originally posted by @jamescrosswell in #5039
Originally posted by @jamescrosswell in #5039