Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types of hidden properties to Sentry data #20457

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Aug 15, 2023

Explanation

The masked wallet state object sent to Sentry has been updated to include the type of each property omitted from the mask. This lets us at least see the full state shape, making it easier to see when errors are caused by invalid state.

Relates to #20449

Manual Testing Steps

This is demonstrated by the "errors" e2e tests (see the state snapshots in the diff). You can manually test by performing the same steps as the tests.

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

danjm
danjm previously approved these changes Aug 16, 2023
Copy link
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

LGTM

@Gudahtt Gudahtt force-pushed the use-unflattened-sentry-state-for-sentry branch from 8eac93c to de1237b Compare August 16, 2023 12:37
@Gudahtt Gudahtt force-pushed the enhance-masked-sentry-data branch from 55a7edb to 8eb3eaa Compare August 16, 2023 12:37
@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #20457 (49d79aa) into develop (b2a56ca) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop   #20457      +/-   ##
===========================================
- Coverage    68.71%   68.71%   -0.00%     
===========================================
  Files          991      991              
  Lines        38426    38428       +2     
  Branches     10312    10313       +1     
===========================================
  Hits         26402    26402              
- Misses       12024    12026       +2     
Files Changed Coverage Δ
shared/modules/object.utils.js 0.00% <0.00%> (ø)

dan437
dan437 previously approved these changes Aug 16, 2023
@danjm danjm added the release-10.34.5 Issue or pull request that will be included in release 10.34.5 label Aug 16, 2023
@danjm danjm mentioned this pull request Aug 16, 2023
@Gudahtt Gudahtt force-pushed the use-unflattened-sentry-state-for-sentry branch from de1237b to a88fb53 Compare August 16, 2023 17:17
Base automatically changed from use-unflattened-sentry-state-for-sentry to develop August 16, 2023 17:51
@Gudahtt Gudahtt dismissed stale reviews from dan437 and danjm August 16, 2023 17:51

The base branch was changed.

@Gudahtt Gudahtt force-pushed the enhance-masked-sentry-data branch from 8eb3eaa to 495cafa Compare August 16, 2023 17:55
@Gudahtt Gudahtt marked this pull request as ready for review August 16, 2023 17:59
@Gudahtt Gudahtt requested a review from a team as a code owner August 16, 2023 17:59
danjm
danjm previously approved these changes Aug 16, 2023
Copy link
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

LGTM

@Gudahtt
Copy link
Member Author

Gudahtt commented Aug 16, 2023

I'm investigating the e2e test failures. Looks like a timing issue.

mcmire
mcmire previously approved these changes Aug 16, 2023
@Gudahtt Gudahtt dismissed stale reviews from mcmire and danjm via f13932f August 16, 2023 21:33
@Gudahtt Gudahtt force-pushed the enhance-masked-sentry-data branch from f13932f to a971500 Compare August 16, 2023 21:33
@Gudahtt
Copy link
Member Author

Gudahtt commented Aug 16, 2023

I found that certain background state properties were causing inconsistencies between Chrome and Firefox because they were set to undefined, which gets serialized differently between browsers. I also found that the currentBlockGasLimit property was timing-dependent.

For now I have excluded these properties from the snapshots. In each case I have a better solution in mind that I will pursue in later PRs, but that need not block this PR.

@Gudahtt Gudahtt requested review from danjm, mcmire and dan437 August 16, 2023 21:48
@metamaskbot
Copy link
Collaborator

Builds ready [a971500]
Page Load Metrics (1547 ± 54 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint111183141199
domContentLoaded13561934154611354
load13561934154711354
domInteractive13561933154611354
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 14 Bytes (0.00%)

The masked wallet state object sent to Sentry has been updated to
include the type of each property omitted from the mask. This lets us
at least see the full state shape, making it easier to see when errors
are caused by invalid state.

Relates to #20449
The state snapshot tests have been updated to exclude properties that
were shown to differ between runs.
@Gudahtt Gudahtt force-pushed the enhance-masked-sentry-data branch from a971500 to 49d79aa Compare August 16, 2023 22:20
Copy link
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

Looks good. The recent changes makes sense

@metamaskbot
Copy link
Collaborator

Builds ready [49d79aa]
Page Load Metrics (1563 ± 46 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint107153129126
domContentLoaded1419184015619646
load1419184015639646
domInteractive1419184015619646
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 14 Bytes (0.00%)

@Gudahtt Gudahtt merged commit 1f508a3 into develop Aug 16, 2023
@Gudahtt Gudahtt deleted the enhance-masked-sentry-data branch August 16, 2023 23:41
@github-actions github-actions bot locked and limited conversation to collaborators Aug 16, 2023
@metamaskbot metamaskbot added the release-10.36.0 Issue or pull request that will be included in release 10.36.0 label Aug 16, 2023
@Gudahtt Gudahtt removed the release-10.36.0 Issue or pull request that will be included in release 10.36.0 label Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-10.34.5 Issue or pull request that will be included in release 10.34.5 release-blocker This bug is blocking the next release team-extension-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants