feat: Provide normalizeDepth option and sensible default for scope methods#2404
Merged
kamilogorek merged 1 commit intomasterfrom Feb 3, 2020
Merged
feat: Provide normalizeDepth option and sensible default for scope methods#2404kamilogorek merged 1 commit intomasterfrom
kamilogorek merged 1 commit intomasterfrom
Conversation
Contributor
Member
|
👍🏻 |
cdda656 to
e562bc5
Compare
kamilogorek
commented
Jan 31, 2020
| extra: { | ||
| arguments: normalize(handlerData.args, 3), | ||
| }, | ||
| arguments: handlerData.args, |
Contributor
Author
There was a problem hiding this comment.
This is "kinda" breaking if someone is relying on such an odd data point, but if we won't change it, it'll have same issue as the one described for ExtractErrorData
kamilogorek
commented
Jan 31, 2020
| */ | ||
| public setUser(user: User | null): this { | ||
| this._user = normalize(user); | ||
| this._user = user || {}; |
Contributor
Author
There was a problem hiding this comment.
The implementation here was incorrect from the beginning. normalize returned any, so we did this._user = <any>, which shouldn't be allowed, as this._user is a non-optional User type. Also, clear sets it to {} not null.
HazAT
requested changes
Feb 3, 2020
Member
HazAT
left a comment
There was a problem hiding this comment.
One nit + Changelog please.
Otherwise LGTM
f0a2d9a to
234845f
Compare
4 tasks
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The initial issue wasn't with an incorrect circular algorithm implementation. It was with recursive references with a large payload, that were outgrowing the stack.
The most basic way to crash it:
The only notable change here is a conflict with
ExtractErrorDatathat keeps error details one level deeper than regular "scope data", eg.contexts.errorName.data, notcontexts.keyso it's owndepthoption will be effectively ignored whennormalizeDepthvalue is smaller.Similar thing would happen for console breadcrumbs integration, as it keeps the data in
breadcrumb.data.arguments, but because I only normalizebreadcrumb.data, it doesn't affect it.Fixes #2178
Fixes #2311
Fixes #2359
Fixes #2366
Fixes #2375