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: Don't show third party notice for preinstalled Snaps #27319

Merged

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Sep 21, 2024

Description

We show a third party notice when installing or connecting to a Snap for the first time. Preinstalled Snaps are first party Snaps however, so we don't need to show the warning for these Snaps. I've implemented some logic that checks if the requested Snap is a preinstalled Snap, and only show the third party notice if it's not.

Open in GitHub Codespaces

Related issues

Fixes: MetaMask/MetaMask-planning#3325.

Manual testing steps

Assuming you have not accepted the third party notice before:

  1. Go to the Test Snaps page
  2. Connect to the preinstalled Snap, and verify the notice is not shown
  3. Connect to any other Snap, and verify that the notice is shown

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.

@Mrtenz Mrtenz changed the title Don't show third party notice for preinstalled Snaps fix: Don't show third party notice for preinstalled Snaps Sep 21, 2024
@github-actions github-actions bot added the team-snaps-platform Snaps Platform team label Sep 21, 2024
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Sep 21, 2024
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
7.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@metamaskbot
Copy link
Collaborator

Builds ready [78ee5b7]
Page Load Metrics (1505 ± 57 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint13981927151611555
domContentLoaded13901846148410550
load13971933150511857
domInteractive178128168
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 70 Bytes (0.00%)
  • common: 156 Bytes (0.00%)

@Mrtenz Mrtenz marked this pull request as ready for review September 21, 2024 11:42
@Mrtenz Mrtenz requested review from a team as code owners September 21, 2024 11:42
Copy link
Contributor

@legobeat legobeat left a comment

Choose a reason for hiding this comment

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

Maybe this would benefit from a test-case or two?

@Mrtenz
Copy link
Member Author

Mrtenz commented Sep 24, 2024

Maybe this would benefit from a test-case or two?

It certainly would, but I'm trying to get it cherry-picked ASAP and the entire component is untested 😞

@Mrtenz Mrtenz merged commit 5cc14af into develop Sep 24, 2024
87 of 89 checks passed
@Mrtenz Mrtenz deleted the mrtenz/remove-third-party-warning-for-preinstalled-snaps branch September 24, 2024 05:07
@github-actions github-actions bot locked and limited conversation to collaborators Sep 24, 2024
@metamaskbot metamaskbot added release-12.6.0 Issue or pull request that will be included in release 12.6.0 release-12.5.0 Issue or pull request that will be included in release 12.5.0 and removed release-12.6.0 Issue or pull request that will be included in release 12.6.0 labels Sep 24, 2024
getSnapMetadata(state, snapId),
);

const isPreinstalled = Object.keys(preinstalledSnaps).includes(snapId);
Copy link
Member

Choose a reason for hiding this comment

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

Seems like this would make us skip the third party notice if multiple Snaps are installed where one is preinstalled? That seems wrong to me 🤔

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template release-12.5.0 Issue or pull request that will be included in release 12.5.0 team-snaps-platform Snaps Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants