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: notification services controller missing env vars #4530

Merged

Conversation

Prithpal-Sooriya
Copy link
Contributor

Explanation

If platforms try to use this controller but pass invalid environment variables, we will make unnecessary calls to fetch feature announcements that will fail. (This mostly happens in Extension, where some controllers are in JS and do not provide type errors).

NOTE - that a new service is being developed to deliver feature announcements, which might allow us to not require platforms to pass in an environment.

References

NOTIFY-848

Changelog

@metamask/notification-services-controller

  • CHANGED: Updated notification mocks to use realistic tx hashes
  • FIXED: Logic to check feature announcement environment before fetching

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@Prithpal-Sooriya
Copy link
Contributor Author

@metamaskbot publish-preview

Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "17.2.0-preview-e9effc96",
  "@metamask-previews/address-book-controller": "5.0.0-preview-e9effc96",
  "@metamask-previews/announcement-controller": "7.0.0-preview-e9effc96",
  "@metamask-previews/approval-controller": "7.0.1-preview-e9effc96",
  "@metamask-previews/assets-controllers": "36.0.0-preview-e9effc96",
  "@metamask-previews/base-controller": "6.0.1-preview-e9effc96",
  "@metamask-previews/build-utils": "3.0.0-preview-e9effc96",
  "@metamask-previews/chain-controller": "0.1.0-preview-e9effc96",
  "@metamask-previews/composable-controller": "7.0.0-preview-e9effc96",
  "@metamask-previews/controller-utils": "11.0.1-preview-e9effc96",
  "@metamask-previews/ens-controller": "13.0.0-preview-e9effc96",
  "@metamask-previews/eth-json-rpc-provider": "4.1.1-preview-e9effc96",
  "@metamask-previews/gas-fee-controller": "19.0.0-preview-e9effc96",
  "@metamask-previews/json-rpc-engine": "9.0.1-preview-e9effc96",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.1-preview-e9effc96",
  "@metamask-previews/keyring-controller": "17.1.1-preview-e9effc96",
  "@metamask-previews/logging-controller": "5.0.0-preview-e9effc96",
  "@metamask-previews/message-manager": "10.0.1-preview-e9effc96",
  "@metamask-previews/name-controller": "8.0.0-preview-e9effc96",
  "@metamask-previews/network-controller": "20.0.0-preview-e9effc96",
  "@metamask-previews/notification-controller": "6.0.0-preview-e9effc96",
  "@metamask-previews/notification-services-controller": "0.1.1-preview-e9effc96",
  "@metamask-previews/permission-controller": "10.0.1-preview-e9effc96",
  "@metamask-previews/permission-log-controller": "3.0.0-preview-e9effc96",
  "@metamask-previews/phishing-controller": "10.1.0-preview-e9effc96",
  "@metamask-previews/polling-controller": "9.0.0-preview-e9effc96",
  "@metamask-previews/preferences-controller": "13.0.0-preview-e9effc96",
  "@metamask-previews/profile-sync-controller": "0.1.3-preview-e9effc96",
  "@metamask-previews/queued-request-controller": "3.0.0-preview-e9effc96",
  "@metamask-previews/rate-limit-controller": "6.0.0-preview-e9effc96",
  "@metamask-previews/selected-network-controller": "16.0.0-preview-e9effc96",
  "@metamask-previews/signature-controller": "18.0.0-preview-e9effc96",
  "@metamask-previews/transaction-controller": "35.0.0-preview-e9effc96",
  "@metamask-previews/user-operation-controller": "14.0.0-preview-e9effc96"
}

matteoscurati
matteoscurati previously approved these changes Jul 18, 2024
Copy link
Contributor

@matteoscurati matteoscurati left a comment

Choose a reason for hiding this comment

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

lgtm!

mathieuartu
mathieuartu previously approved these changes Jul 18, 2024
Copy link
Contributor

@mathieuartu mathieuartu left a comment

Choose a reason for hiding this comment

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

🛹🛹🛹

@Prithpal-Sooriya Prithpal-Sooriya merged commit 7969752 into main Jul 18, 2024
116 checks passed
@Prithpal-Sooriya Prithpal-Sooriya deleted the fix/notification-services-controller-missing-env-vars branch July 18, 2024 14:41
Prithpal-Sooriya added a commit to MetaMask/metamask-extension that referenced this pull request Jul 19, 2024
## **Description**

This is a series of fixes added to core libraries. Adding to extension,
and soon we will migrate extension to use shared libraries.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25946?quickstart=1)

## **Related issues**

MetaMask/core#4530
MetaMask/core#4531
MetaMask/core#4532
MetaMask/core#4533
MetaMask/core#4536

#25749

## **Manual testing steps**

1. Create multiple accounts
2. Go to notification settings page
3. Wait for settings to load, and try toggling notifications

Before: some settings would error or not load
After: you should be able to toggle accounts and not see errors.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

[<!-- [screenshots/recordings]
-->](#25749)

### **After**


https://www.loom.com/share/49b582e8c33b4199bdafc994a3f6087f?sid=9f94a885-351b-4fee-84d8-f72c97506e7d

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
Prithpal-Sooriya added a commit to MetaMask/metamask-extension that referenced this pull request Jul 19, 2024
## **Description**

This is a series of fixes added to core libraries. Adding to extension,
and soon we will migrate extension to use shared libraries.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25946?quickstart=1)

## **Related issues**

MetaMask/core#4530
MetaMask/core#4531
MetaMask/core#4532
MetaMask/core#4533
MetaMask/core#4536

#25749

## **Manual testing steps**

1. Create multiple accounts
2. Go to notification settings page
3. Wait for settings to load, and try toggling notifications

Before: some settings would error or not load
After: you should be able to toggle accounts and not see errors.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

[<!-- [screenshots/recordings]
-->](#25749)

### **After**


https://www.loom.com/share/49b582e8c33b4199bdafc994a3f6087f?sid=9f94a885-351b-4fee-84d8-f72c97506e7d

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
chloeYue pushed a commit to MetaMask/metamask-extension that referenced this pull request Jul 19, 2024
)

## **Description**

This is a cherry pick for
#25946
(003ee98)

------

This is a series of fixes added to core libraries. Adding to extension,
and soon we will migrate extension to use shared libraries.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25946?quickstart=1)

## **Related issues**

MetaMask/core#4530
MetaMask/core#4531
MetaMask/core#4532
MetaMask/core#4533
MetaMask/core#4536

#25749

## **Manual testing steps**

1. Create multiple accounts
2. Go to notification settings page
3. Wait for settings to load, and try toggling notifications

Before: some settings would error or not load
After: you should be able to toggle accounts and not see errors.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

[<!-- [screenshots/recordings]
-->](#25749)

### **After**


https://www.loom.com/share/49b582e8c33b4199bdafc994a3f6087f?sid=9f94a885-351b-4fee-84d8-f72c97506e7d

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-notifications Notification Team changes. https://github.com/orgs/MetaMask/teams/notifications
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants