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

fix: remove unused code to overwrite filenames for Sentry error reporting #6945

Merged
merged 6 commits into from
Aug 15, 2023

Conversation

sethkfman
Copy link
Contributor

@sethkfman sethkfman commented Aug 1, 2023

Development & PR Process

  1. Follow MetaMask Mobile Coding Standards
  2. Add release-xx label to identify the PR slated for a upcoming release (will be used in release discussion)
  3. Add needs-dev-review label when work is completed
  4. Add the appropiate QA label when dev review is completed
    • needs-qa: PR requires manual QA.
    • No QA/E2E only: PR does not require any manual QA effort. Prior to merging, ensure that you have successful end-to-end test runs in Bitrise.
    • Spot check on release build: PR does not require feature QA but needs non-automated verification. In the description section, provide test scenarios. Add screenshots, and or recordings of what was tested.
  5. Add QA Passed label when QA has signed off (Only required if the PR was labeled with needs-qa)

Description

This PR fixes the way we are processing Sentry errors.

  • The code in question was initially pulled from work done by the extension team during the privacy work in December.
  • This was added but does not seem to be providing any privacy related value and introduces a Sentry error logging bug overwriting the filename when error occurs. The context behind the code can be found in this extension PR.

Test evidence
Logging Before

    {
        "colno": null,
        "filename": "metamask-mobile",
        "function": "_onChangeTab",
        "in_app": false,
        "lineno": undefined,
        "platform": "node"
    },
   {
        "colno": 4,
        "filename": "metamask-mobile",
        "function": "createReactClass$argument_0._onChangeTab",
        "in_app": false,
        "lineno": undefined,
        "platform": "node"
    },
    {
        "colno": 17,
        "context_line": "    Logger.error(new Error(), \"Error while checking What's New modal!\");",
        "filename": "metamask-mobile",
        "function": "onChangeTab",
        "in_app": true,
        "lineno": 231,
        "platform": "javascript",
        "post_context": [
            "  }, []);",
            "",
            "  const renderContent = useCallback(() => {",
            "    let balance: any = 0;",
            "    let assets = tokens;"
        ],
        "pre_context": [
            "        Analytics.trackEvent(MetaMetricsEvents.WALLET_TOKENS);",
            "      } else {",
            "        Analytics.trackEvent(MetaMetricsEvents.WALLET_COLLECTIBLES);",
            "      }",
            "    });"
        ]
    }

Logging After

    {
        "colno": null,
        "filename": "[native code]",
        "function": "_onChangeTab",
        "in_app": false,
        "lineno": undefined,
        "platform": "node"
    },
    {
        "colno": 4,
        "filename": "app:///index.js",
        "function": "createReactClass$argument_0._onChangeTab",
        "in_app": false,
        "lineno": undefined,
        "platform": "node"
    },
    {
        "colno": 17,
        "context_line": "    Logger.error(new Error(), \"Error while checking What's New modal!\");",
        "filename": "app:///index.tsx",
        "function": "onChangeTab",
        "in_app": true,
        "lineno": 231,
        "platform": "javascript",
        "post_context": [
            "  }, []);",
            "",
            "  const renderContent = useCallback(() => {",
            "    let balance: any = 0;",
            "    let assets = tokens;"
        ],
        "pre_context": [
            "        Analytics.trackEvent(MetaMetricsEvents.WALLET_TOKENS);",
            "      } else {",
            "        Analytics.trackEvent(MetaMetricsEvents.WALLET_COLLECTIBLES);",
            "      }",
            "    });"
        ]
    }

Issue

NA

Checklist

  • [NA] There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

@sethkfman sethkfman added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Aug 1, 2023
@sethkfman sethkfman requested a review from a team as a code owner August 1, 2023 22:23
@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@sethkfman sethkfman requested a review from Gudahtt August 1, 2023 22:23
@sethkfman sethkfman added the No QA Needed/E2E Only Apply this label when your PR does not need any QA effort. label Aug 2, 2023
@sethkfman
Copy link
Contributor Author

@Gudahtt I have completed removed the function since the purpose of it was to enable a single sourcemap on extension and mobile does not have that configuration. The function does not impact privacy.

@sonarcloud
Copy link

sonarcloud bot commented Aug 4, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@sethkfman sethkfman merged commit b22627d into main Aug 15, 2023
11 checks passed
@sethkfman sethkfman deleted the fix/sentry-error-reporting branch August 15, 2023 21:04
@github-actions github-actions bot locked and limited conversation to collaborators Aug 15, 2023
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Aug 15, 2023
@sethkfman sethkfman added the release-7.6.0 Issue or pull request that will be included in release 7.6.0 label Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No QA Needed/E2E Only Apply this label when your PR does not need any QA effort. release-7.6.0 Issue or pull request that will be included in release 7.6.0 team-mobile-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants