Skip to content

feat(utils): Add add_remark functionality to Meta class#44884

Merged
AbhiPrasad merged 2 commits intomasterfrom
abhi-meta-class-remark
Feb 23, 2023
Merged

feat(utils): Add add_remark functionality to Meta class#44884
AbhiPrasad merged 2 commits intomasterfrom
abhi-meta-class-remark

Conversation

@AbhiPrasad
Copy link
Contributor

@AbhiPrasad AbhiPrasad commented Feb 21, 2023

In preparation for the work in #44877, add the ability to add remarks via a Meta class utility, similar to what is in Relay: https://github.com/getsentry/relay/blob/master/relay-general/src/types/meta.rs#L38.

With this change it might seem that we should refactor the class so that add_error and add_remark are no longer duplicated. I didn't think this was worth the time investment, as the class is actually not used anywhere at the moment

The tests are fairly basic. I figured it's not worth the time to duplicate the add_error tests, we can always come back to this if there is more usage of the func. In addition, in the next PR we'll be leveraging add_remark in the JS processor, so more tests will come to check to robustness of the method.

After this gets merged in, the next step is to update the JS processor to add this remark, so that the UI can then tell that the react minified errors processor replaced an exception value.

I'm half of mind to just throw this in Relay, because the processor code isn't actually that complicated, but probably not worth the time investment.

@AbhiPrasad AbhiPrasad requested a review from jan-auer February 21, 2023 11:49
@AbhiPrasad AbhiPrasad self-assigned this Feb 21, 2023
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 21, 2023
Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using this, please consider to add a test that runs the final payload through renormalization to avoid deserialization issues.

Comment on lines +10 to +11
range_start: Optional[int]
range_end: Optional[int]
Copy link
Member

@jan-auer jan-auer Feb 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This range is in bytes, not UTF8 codepoints. It could be worth pointing this out explicitly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made these changes in a follow up PR - will point them out there.

@AbhiPrasad AbhiPrasad merged commit a73a86d into master Feb 23, 2023
@AbhiPrasad AbhiPrasad deleted the abhi-meta-class-remark branch February 23, 2023 08:04
AbhiPrasad added a commit that referenced this pull request Feb 24, 2023
…45030)

Continuing our work from #44884,
this PR takes the `add_remark` implementation from there and uses it to
add a substitution remark every time we process a react minified event
message.

In addition, as per feedback, we also test to make sure that store
normalization works properly with this new set up.
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants