Skip to content

fix: blockaid report url in redesigned pages#25702

Merged
jpuri merged 5 commits intodevelopfrom
blockaid_reporturl_fix
Jul 10, 2024
Merged

fix: blockaid report url in redesigned pages#25702
jpuri merged 5 commits intodevelopfrom
blockaid_reporturl_fix

Conversation

@jpuri
Copy link
Copy Markdown
Contributor

@jpuri jpuri commented Jul 5, 2024

Description

Fix blockaid reportUrl in redesigned pages.

Related issues

Fixes: #25656

Manual testing steps

  1. Go to malicious permit page
  2. Check report url

Screenshots/Recordings

NA

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@jpuri jpuri added confirmation-redesign team-confirmations Push issues to confirmations team labels Jul 5, 2024
@jpuri jpuri requested review from a team as code owners July 5, 2024 14:17
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 5, 2024

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.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Jul 5, 2024

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.81%. Comparing base (f9f0c73) to head (7d6874e).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25702      +/-   ##
===========================================
+ Coverage    69.79%   69.81%   +0.01%     
===========================================
  Files         1377     1377              
  Lines        48435    48452      +17     
  Branches     13354    13362       +8     
===========================================
+ Hits         33805    33823      +18     
+ Misses       14630    14629       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [7d6874e]
Page Load Metrics (306 ± 271 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint70140102188
domContentLoaded95427126
load421704306565271
domInteractive95427126
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 1.45 KiB (0.02%)
  • common: 0 Bytes (0.00%)


expect(result.current).toHaveLength(1);
expect(result.current[0].reportUrl).toBeDefined();
delete result.current[0].reportUrl;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why not add the reportUrl to the EXPECTED_ALERT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

reportUrl generated are different on local and CI I think due to zip utility and that breaks the unit test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could we add this as a comment where we delete reportUrl?

Comment on lines +128 to +138
let reportUrl = ZENDESK_URLS.SUPPORT_URL;
if (stringifiedJSONData) {
const encodedData =
zlib?.gzipSync?.(stringifiedJSONData) ?? stringifiedJSONData;

reportUrl = `${FALSE_POSITIVE_REPORT_BASE_URL}?data=${encodeURIComponent(
encodedData.toString('base64'),
)}&utm_source=${SECURITY_PROVIDER_UTM_SOURCE}`;
}

return [normalizeProviderAlert(securityAlertResponse, t, reportUrl)];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this duplicating existing logic that is already in blackaid-banner-alert.js?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

blackaid-banner-alert is old code that we will eventually get rid of and replace by this code.

/**
* URL to report issue.
*/
reportUrl?: string;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will reportUrl always be present? If so , should we update the type?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Its optional

@jpuri jpuri requested a review from davidmurdoch July 8, 2024 05:31
@jpuri jpuri merged commit 209d566 into develop Jul 10, 2024
@jpuri jpuri deleted the blockaid_reporturl_fix branch July 10, 2024 13:58
@github-actions github-actions bot locked and limited conversation to collaborators Jul 10, 2024
@metamaskbot metamaskbot added the release-12.2.0 Issue or pull request that will be included in release 12.2.0 label Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

confirmation-redesign release-12.2.0 Issue or pull request that will be included in release 12.2.0 team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Blockaid - Report false positive link from the Blockaid working is incorrect

6 participants