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

Override subscriptionManager.middleware.destroy to also remove sub entry #4984

Merged

Conversation

jiexi
Copy link
Contributor

@jiexi jiexi commented Nov 26, 2024

Explanation

Ensures that the subscription entry for a subscription is removed when the middleware is destroyed

References

Related: MetaMask/metamask-extension#28751

Changelog

@metamask/package-a

  • : Your change here
  • : Your change here

@metamask/package-b

  • : Your change here
  • : Your change here

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
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@jiexi
Copy link
Contributor Author

jiexi commented Nov 26, 2024

@metamaskbot publish-preview

@jiexi
Copy link
Contributor Author

jiexi commented Nov 26, 2024

@metamaskbot publish-previews

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": "20.0.0-preview-7f262294",
  "@metamask-previews/address-book-controller": "6.0.1-preview-7f262294",
  "@metamask-previews/announcement-controller": "7.0.1-preview-7f262294",
  "@metamask-previews/approval-controller": "7.1.1-preview-7f262294",
  "@metamask-previews/assets-controllers": "45.1.0-preview-7f262294",
  "@metamask-previews/base-controller": "7.0.2-preview-7f262294",
  "@metamask-previews/build-utils": "3.0.1-preview-7f262294",
  "@metamask-previews/chain-controller": "0.2.0-preview-7f262294",
  "@metamask-previews/composable-controller": "9.0.1-preview-7f262294",
  "@metamask-previews/controller-utils": "11.4.3-preview-7f262294",
  "@metamask-previews/ens-controller": "15.0.0-preview-7f262294",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-7f262294",
  "@metamask-previews/gas-fee-controller": "22.0.1-preview-7f262294",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-7f262294",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-7f262294",
  "@metamask-previews/keyring-controller": "19.0.0-preview-7f262294",
  "@metamask-previews/logging-controller": "6.0.2-preview-7f262294",
  "@metamask-previews/message-manager": "11.0.1-preview-7f262294",
  "@metamask-previews/multichain": "1.1.0-preview-7f262294",
  "@metamask-previews/name-controller": "8.0.1-preview-7f262294",
  "@metamask-previews/network-controller": "22.0.2-preview-7f262294",
  "@metamask-previews/notification-controller": "7.0.0-preview-7f262294",
  "@metamask-previews/notification-services-controller": "0.14.0-preview-7f262294",
  "@metamask-previews/permission-controller": "11.0.3-preview-7f262294",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-7f262294",
  "@metamask-previews/phishing-controller": "12.3.0-preview-7f262294",
  "@metamask-previews/polling-controller": "12.0.1-preview-7f262294",
  "@metamask-previews/preferences-controller": "15.0.0-preview-7f262294",
  "@metamask-previews/profile-sync-controller": "2.0.0-preview-7f262294",
  "@metamask-previews/queued-request-controller": "8.0.0-preview-7f262294",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-7f262294",
  "@metamask-previews/selected-network-controller": "20.0.0-preview-7f262294",
  "@metamask-previews/signature-controller": "23.0.0-preview-7f262294",
  "@metamask-previews/transaction-controller": "41.0.0-preview-7f262294",
  "@metamask-previews/user-operation-controller": "20.0.0-preview-7f262294"
}

@jiexi
Copy link
Contributor Author

jiexi commented Nov 27, 2024

@metamaskbot publish-previews

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": "20.0.0-preview-8a04affb",
  "@metamask-previews/address-book-controller": "6.0.1-preview-8a04affb",
  "@metamask-previews/announcement-controller": "7.0.1-preview-8a04affb",
  "@metamask-previews/approval-controller": "7.1.1-preview-8a04affb",
  "@metamask-previews/assets-controllers": "45.1.0-preview-8a04affb",
  "@metamask-previews/base-controller": "7.0.2-preview-8a04affb",
  "@metamask-previews/build-utils": "3.0.1-preview-8a04affb",
  "@metamask-previews/chain-controller": "0.2.0-preview-8a04affb",
  "@metamask-previews/composable-controller": "9.0.1-preview-8a04affb",
  "@metamask-previews/controller-utils": "11.4.3-preview-8a04affb",
  "@metamask-previews/ens-controller": "15.0.0-preview-8a04affb",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-8a04affb",
  "@metamask-previews/gas-fee-controller": "22.0.1-preview-8a04affb",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-8a04affb",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-8a04affb",
  "@metamask-previews/keyring-controller": "19.0.0-preview-8a04affb",
  "@metamask-previews/logging-controller": "6.0.2-preview-8a04affb",
  "@metamask-previews/message-manager": "11.0.1-preview-8a04affb",
  "@metamask-previews/multichain": "1.1.0-preview-8a04affb",
  "@metamask-previews/name-controller": "8.0.1-preview-8a04affb",
  "@metamask-previews/network-controller": "22.0.2-preview-8a04affb",
  "@metamask-previews/notification-controller": "7.0.0-preview-8a04affb",
  "@metamask-previews/notification-services-controller": "0.14.0-preview-8a04affb",
  "@metamask-previews/permission-controller": "11.0.3-preview-8a04affb",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-8a04affb",
  "@metamask-previews/phishing-controller": "12.3.0-preview-8a04affb",
  "@metamask-previews/polling-controller": "12.0.1-preview-8a04affb",
  "@metamask-previews/preferences-controller": "15.0.0-preview-8a04affb",
  "@metamask-previews/profile-sync-controller": "2.0.0-preview-8a04affb",
  "@metamask-previews/queued-request-controller": "8.0.0-preview-8a04affb",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-8a04affb",
  "@metamask-previews/selected-network-controller": "20.0.0-preview-8a04affb",
  "@metamask-previews/signature-controller": "23.0.0-preview-8a04affb",
  "@metamask-previews/transaction-controller": "41.0.0-preview-8a04affb",
  "@metamask-previews/user-operation-controller": "20.0.0-preview-8a04affb"
}

@jiexi
Copy link
Contributor Author

jiexi commented Nov 27, 2024

@metamaskbot publish-previews

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": "20.0.0-preview-ad39b13e",
  "@metamask-previews/address-book-controller": "6.0.1-preview-ad39b13e",
  "@metamask-previews/announcement-controller": "7.0.1-preview-ad39b13e",
  "@metamask-previews/approval-controller": "7.1.1-preview-ad39b13e",
  "@metamask-previews/assets-controllers": "45.1.0-preview-ad39b13e",
  "@metamask-previews/base-controller": "7.0.2-preview-ad39b13e",
  "@metamask-previews/build-utils": "3.0.1-preview-ad39b13e",
  "@metamask-previews/chain-controller": "0.2.0-preview-ad39b13e",
  "@metamask-previews/composable-controller": "9.0.1-preview-ad39b13e",
  "@metamask-previews/controller-utils": "11.4.3-preview-ad39b13e",
  "@metamask-previews/ens-controller": "15.0.0-preview-ad39b13e",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-ad39b13e",
  "@metamask-previews/gas-fee-controller": "22.0.1-preview-ad39b13e",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-ad39b13e",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-ad39b13e",
  "@metamask-previews/keyring-controller": "19.0.0-preview-ad39b13e",
  "@metamask-previews/logging-controller": "6.0.2-preview-ad39b13e",
  "@metamask-previews/message-manager": "11.0.1-preview-ad39b13e",
  "@metamask-previews/multichain": "1.1.0-preview-ad39b13e",
  "@metamask-previews/name-controller": "8.0.1-preview-ad39b13e",
  "@metamask-previews/network-controller": "22.0.2-preview-ad39b13e",
  "@metamask-previews/notification-controller": "7.0.0-preview-ad39b13e",
  "@metamask-previews/notification-services-controller": "0.14.0-preview-ad39b13e",
  "@metamask-previews/permission-controller": "11.0.3-preview-ad39b13e",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-ad39b13e",
  "@metamask-previews/phishing-controller": "12.3.0-preview-ad39b13e",
  "@metamask-previews/polling-controller": "12.0.1-preview-ad39b13e",
  "@metamask-previews/preferences-controller": "15.0.0-preview-ad39b13e",
  "@metamask-previews/profile-sync-controller": "2.0.0-preview-ad39b13e",
  "@metamask-previews/queued-request-controller": "8.0.0-preview-ad39b13e",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-ad39b13e",
  "@metamask-previews/selected-network-controller": "20.0.0-preview-ad39b13e",
  "@metamask-previews/signature-controller": "23.0.0-preview-ad39b13e",
  "@metamask-previews/transaction-controller": "41.0.0-preview-ad39b13e",
  "@metamask-previews/user-operation-controller": "20.0.0-preview-ad39b13e"
}

@jiexi
Copy link
Contributor Author

jiexi commented Nov 27, 2024

@metamaskbot publish-previews

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": "20.0.0-preview-f06d0346",
  "@metamask-previews/address-book-controller": "6.0.1-preview-f06d0346",
  "@metamask-previews/announcement-controller": "7.0.1-preview-f06d0346",
  "@metamask-previews/approval-controller": "7.1.1-preview-f06d0346",
  "@metamask-previews/assets-controllers": "45.1.0-preview-f06d0346",
  "@metamask-previews/base-controller": "7.0.2-preview-f06d0346",
  "@metamask-previews/build-utils": "3.0.1-preview-f06d0346",
  "@metamask-previews/chain-controller": "0.2.0-preview-f06d0346",
  "@metamask-previews/composable-controller": "9.0.1-preview-f06d0346",
  "@metamask-previews/controller-utils": "11.4.3-preview-f06d0346",
  "@metamask-previews/ens-controller": "15.0.0-preview-f06d0346",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-f06d0346",
  "@metamask-previews/gas-fee-controller": "22.0.1-preview-f06d0346",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-f06d0346",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-f06d0346",
  "@metamask-previews/keyring-controller": "19.0.0-preview-f06d0346",
  "@metamask-previews/logging-controller": "6.0.2-preview-f06d0346",
  "@metamask-previews/message-manager": "11.0.1-preview-f06d0346",
  "@metamask-previews/multichain": "1.1.0-preview-f06d0346",
  "@metamask-previews/name-controller": "8.0.1-preview-f06d0346",
  "@metamask-previews/network-controller": "22.0.2-preview-f06d0346",
  "@metamask-previews/notification-controller": "7.0.0-preview-f06d0346",
  "@metamask-previews/notification-services-controller": "0.14.0-preview-f06d0346",
  "@metamask-previews/permission-controller": "11.0.3-preview-f06d0346",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-f06d0346",
  "@metamask-previews/phishing-controller": "12.3.0-preview-f06d0346",
  "@metamask-previews/polling-controller": "12.0.1-preview-f06d0346",
  "@metamask-previews/preferences-controller": "15.0.0-preview-f06d0346",
  "@metamask-previews/profile-sync-controller": "2.0.0-preview-f06d0346",
  "@metamask-previews/queued-request-controller": "8.0.0-preview-f06d0346",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-f06d0346",
  "@metamask-previews/selected-network-controller": "20.0.0-preview-f06d0346",
  "@metamask-previews/signature-controller": "23.0.0-preview-f06d0346",
  "@metamask-previews/transaction-controller": "41.0.0-preview-f06d0346",
  "@metamask-previews/user-operation-controller": "20.0.0-preview-f06d0346"
}

@jiexi
Copy link
Contributor Author

jiexi commented Nov 27, 2024

@metamaskbot publish-previews

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": "20.0.0-preview-4fc4dc87",
  "@metamask-previews/address-book-controller": "6.0.1-preview-4fc4dc87",
  "@metamask-previews/announcement-controller": "7.0.1-preview-4fc4dc87",
  "@metamask-previews/approval-controller": "7.1.1-preview-4fc4dc87",
  "@metamask-previews/assets-controllers": "45.1.0-preview-4fc4dc87",
  "@metamask-previews/base-controller": "7.0.2-preview-4fc4dc87",
  "@metamask-previews/build-utils": "3.0.1-preview-4fc4dc87",
  "@metamask-previews/chain-controller": "0.2.0-preview-4fc4dc87",
  "@metamask-previews/composable-controller": "9.0.1-preview-4fc4dc87",
  "@metamask-previews/controller-utils": "11.4.3-preview-4fc4dc87",
  "@metamask-previews/ens-controller": "15.0.0-preview-4fc4dc87",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-4fc4dc87",
  "@metamask-previews/gas-fee-controller": "22.0.1-preview-4fc4dc87",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-4fc4dc87",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-4fc4dc87",
  "@metamask-previews/keyring-controller": "19.0.0-preview-4fc4dc87",
  "@metamask-previews/logging-controller": "6.0.2-preview-4fc4dc87",
  "@metamask-previews/message-manager": "11.0.1-preview-4fc4dc87",
  "@metamask-previews/multichain": "1.1.0-preview-4fc4dc87",
  "@metamask-previews/name-controller": "8.0.1-preview-4fc4dc87",
  "@metamask-previews/network-controller": "22.0.2-preview-4fc4dc87",
  "@metamask-previews/notification-controller": "7.0.0-preview-4fc4dc87",
  "@metamask-previews/notification-services-controller": "0.14.0-preview-4fc4dc87",
  "@metamask-previews/permission-controller": "11.0.3-preview-4fc4dc87",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-4fc4dc87",
  "@metamask-previews/phishing-controller": "12.3.0-preview-4fc4dc87",
  "@metamask-previews/polling-controller": "12.0.1-preview-4fc4dc87",
  "@metamask-previews/preferences-controller": "15.0.0-preview-4fc4dc87",
  "@metamask-previews/profile-sync-controller": "2.0.0-preview-4fc4dc87",
  "@metamask-previews/queued-request-controller": "8.0.0-preview-4fc4dc87",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-4fc4dc87",
  "@metamask-previews/selected-network-controller": "20.0.0-preview-4fc4dc87",
  "@metamask-previews/signature-controller": "23.0.0-preview-4fc4dc87",
  "@metamask-previews/transaction-controller": "41.0.0-preview-4fc4dc87",
  "@metamask-previews/user-operation-controller": "20.0.0-preview-4fc4dc87"
}

@jiexi
Copy link
Contributor Author

jiexi commented Nov 27, 2024

@metamaskbot publish-previews

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": "20.0.0-preview-9b7b95ec",
  "@metamask-previews/address-book-controller": "6.0.1-preview-9b7b95ec",
  "@metamask-previews/announcement-controller": "7.0.1-preview-9b7b95ec",
  "@metamask-previews/approval-controller": "7.1.1-preview-9b7b95ec",
  "@metamask-previews/assets-controllers": "45.1.0-preview-9b7b95ec",
  "@metamask-previews/base-controller": "7.0.2-preview-9b7b95ec",
  "@metamask-previews/build-utils": "3.0.1-preview-9b7b95ec",
  "@metamask-previews/chain-controller": "0.2.0-preview-9b7b95ec",
  "@metamask-previews/composable-controller": "9.0.1-preview-9b7b95ec",
  "@metamask-previews/controller-utils": "11.4.3-preview-9b7b95ec",
  "@metamask-previews/ens-controller": "15.0.0-preview-9b7b95ec",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-9b7b95ec",
  "@metamask-previews/gas-fee-controller": "22.0.1-preview-9b7b95ec",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-9b7b95ec",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-9b7b95ec",
  "@metamask-previews/keyring-controller": "19.0.0-preview-9b7b95ec",
  "@metamask-previews/logging-controller": "6.0.2-preview-9b7b95ec",
  "@metamask-previews/message-manager": "11.0.1-preview-9b7b95ec",
  "@metamask-previews/multichain": "1.1.0-preview-9b7b95ec",
  "@metamask-previews/name-controller": "8.0.1-preview-9b7b95ec",
  "@metamask-previews/network-controller": "22.0.2-preview-9b7b95ec",
  "@metamask-previews/notification-controller": "7.0.0-preview-9b7b95ec",
  "@metamask-previews/notification-services-controller": "0.14.0-preview-9b7b95ec",
  "@metamask-previews/permission-controller": "11.0.3-preview-9b7b95ec",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-9b7b95ec",
  "@metamask-previews/phishing-controller": "12.3.0-preview-9b7b95ec",
  "@metamask-previews/polling-controller": "12.0.1-preview-9b7b95ec",
  "@metamask-previews/preferences-controller": "15.0.0-preview-9b7b95ec",
  "@metamask-previews/profile-sync-controller": "2.0.0-preview-9b7b95ec",
  "@metamask-previews/queued-request-controller": "8.0.0-preview-9b7b95ec",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-9b7b95ec",
  "@metamask-previews/selected-network-controller": "20.0.0-preview-9b7b95ec",
  "@metamask-previews/signature-controller": "23.0.0-preview-9b7b95ec",
  "@metamask-previews/transaction-controller": "41.0.0-preview-9b7b95ec",
  "@metamask-previews/user-operation-controller": "20.0.0-preview-9b7b95ec"
}

@jiexi
Copy link
Contributor Author

jiexi commented Nov 27, 2024

@metamaskbot publish-previews

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": "20.0.0-preview-1c8fd633",
  "@metamask-previews/address-book-controller": "6.0.1-preview-1c8fd633",
  "@metamask-previews/announcement-controller": "7.0.1-preview-1c8fd633",
  "@metamask-previews/approval-controller": "7.1.1-preview-1c8fd633",
  "@metamask-previews/assets-controllers": "45.1.0-preview-1c8fd633",
  "@metamask-previews/base-controller": "7.0.2-preview-1c8fd633",
  "@metamask-previews/build-utils": "3.0.1-preview-1c8fd633",
  "@metamask-previews/chain-controller": "0.2.0-preview-1c8fd633",
  "@metamask-previews/composable-controller": "9.0.1-preview-1c8fd633",
  "@metamask-previews/controller-utils": "11.4.3-preview-1c8fd633",
  "@metamask-previews/ens-controller": "15.0.0-preview-1c8fd633",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-1c8fd633",
  "@metamask-previews/gas-fee-controller": "22.0.1-preview-1c8fd633",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-1c8fd633",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-1c8fd633",
  "@metamask-previews/keyring-controller": "19.0.0-preview-1c8fd633",
  "@metamask-previews/logging-controller": "6.0.2-preview-1c8fd633",
  "@metamask-previews/message-manager": "11.0.1-preview-1c8fd633",
  "@metamask-previews/multichain": "1.1.0-preview-1c8fd633",
  "@metamask-previews/name-controller": "8.0.1-preview-1c8fd633",
  "@metamask-previews/network-controller": "22.0.2-preview-1c8fd633",
  "@metamask-previews/notification-controller": "7.0.0-preview-1c8fd633",
  "@metamask-previews/notification-services-controller": "0.14.0-preview-1c8fd633",
  "@metamask-previews/permission-controller": "11.0.3-preview-1c8fd633",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-1c8fd633",
  "@metamask-previews/phishing-controller": "12.3.0-preview-1c8fd633",
  "@metamask-previews/polling-controller": "12.0.1-preview-1c8fd633",
  "@metamask-previews/preferences-controller": "15.0.0-preview-1c8fd633",
  "@metamask-previews/profile-sync-controller": "2.0.0-preview-1c8fd633",
  "@metamask-previews/queued-request-controller": "8.0.0-preview-1c8fd633",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-1c8fd633",
  "@metamask-previews/selected-network-controller": "20.0.0-preview-1c8fd633",
  "@metamask-previews/signature-controller": "23.0.0-preview-1c8fd633",
  "@metamask-previews/transaction-controller": "41.0.0-preview-1c8fd633",
  "@metamask-previews/user-operation-controller": "20.0.0-preview-1c8fd633"
}

@jiexi
Copy link
Contributor Author

jiexi commented Dec 2, 2024

@metamaskbot publish-previews

Copy link
Contributor

github-actions bot commented Dec 2, 2024

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": "20.0.0-preview-b8323ae4",
  "@metamask-previews/address-book-controller": "6.0.1-preview-b8323ae4",
  "@metamask-previews/announcement-controller": "7.0.1-preview-b8323ae4",
  "@metamask-previews/approval-controller": "7.1.1-preview-b8323ae4",
  "@metamask-previews/assets-controllers": "45.1.0-preview-b8323ae4",
  "@metamask-previews/base-controller": "7.0.2-preview-b8323ae4",
  "@metamask-previews/build-utils": "3.0.1-preview-b8323ae4",
  "@metamask-previews/chain-controller": "0.2.0-preview-b8323ae4",
  "@metamask-previews/composable-controller": "9.0.1-preview-b8323ae4",
  "@metamask-previews/controller-utils": "11.4.3-preview-b8323ae4",
  "@metamask-previews/ens-controller": "15.0.0-preview-b8323ae4",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-b8323ae4",
  "@metamask-previews/gas-fee-controller": "22.0.1-preview-b8323ae4",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-b8323ae4",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-b8323ae4",
  "@metamask-previews/keyring-controller": "19.0.0-preview-b8323ae4",
  "@metamask-previews/logging-controller": "6.0.2-preview-b8323ae4",
  "@metamask-previews/message-manager": "11.0.1-preview-b8323ae4",
  "@metamask-previews/multichain": "1.1.0-preview-b8323ae4",
  "@metamask-previews/name-controller": "8.0.1-preview-b8323ae4",
  "@metamask-previews/network-controller": "22.0.2-preview-b8323ae4",
  "@metamask-previews/notification-services-controller": "0.14.0-preview-b8323ae4",
  "@metamask-previews/permission-controller": "11.0.3-preview-b8323ae4",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-b8323ae4",
  "@metamask-previews/phishing-controller": "12.3.0-preview-b8323ae4",
  "@metamask-previews/polling-controller": "12.0.1-preview-b8323ae4",
  "@metamask-previews/preferences-controller": "15.0.0-preview-b8323ae4",
  "@metamask-previews/profile-sync-controller": "2.0.0-preview-b8323ae4",
  "@metamask-previews/queued-request-controller": "8.0.0-preview-b8323ae4",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-b8323ae4",
  "@metamask-previews/remote-feature-flag-controller": "1.0.0-preview-b8323ae4",
  "@metamask-previews/selected-network-controller": "20.0.0-preview-b8323ae4",
  "@metamask-previews/signature-controller": "23.0.0-preview-b8323ae4",
  "@metamask-previews/transaction-controller": "41.0.0-preview-b8323ae4",
  "@metamask-previews/user-operation-controller": "20.0.0-preview-b8323ae4"
}

@jiexi
Copy link
Contributor Author

jiexi commented Dec 2, 2024

@metamaskbot publish-previews

Copy link
Contributor

github-actions bot commented Dec 2, 2024

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": "20.0.0-preview-fcaebe2b",
  "@metamask-previews/address-book-controller": "6.0.1-preview-fcaebe2b",
  "@metamask-previews/announcement-controller": "7.0.1-preview-fcaebe2b",
  "@metamask-previews/approval-controller": "7.1.1-preview-fcaebe2b",
  "@metamask-previews/assets-controllers": "45.1.0-preview-fcaebe2b",
  "@metamask-previews/base-controller": "7.0.2-preview-fcaebe2b",
  "@metamask-previews/build-utils": "3.0.1-preview-fcaebe2b",
  "@metamask-previews/chain-controller": "0.2.0-preview-fcaebe2b",
  "@metamask-previews/composable-controller": "9.0.1-preview-fcaebe2b",
  "@metamask-previews/controller-utils": "11.4.3-preview-fcaebe2b",
  "@metamask-previews/ens-controller": "15.0.0-preview-fcaebe2b",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-fcaebe2b",
  "@metamask-previews/gas-fee-controller": "22.0.1-preview-fcaebe2b",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-fcaebe2b",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-fcaebe2b",
  "@metamask-previews/keyring-controller": "19.0.0-preview-fcaebe2b",
  "@metamask-previews/logging-controller": "6.0.2-preview-fcaebe2b",
  "@metamask-previews/message-manager": "11.0.1-preview-fcaebe2b",
  "@metamask-previews/multichain": "1.1.0-preview-fcaebe2b",
  "@metamask-previews/name-controller": "8.0.1-preview-fcaebe2b",
  "@metamask-previews/network-controller": "22.0.2-preview-fcaebe2b",
  "@metamask-previews/notification-services-controller": "0.14.0-preview-fcaebe2b",
  "@metamask-previews/permission-controller": "11.0.3-preview-fcaebe2b",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-fcaebe2b",
  "@metamask-previews/phishing-controller": "12.3.0-preview-fcaebe2b",
  "@metamask-previews/polling-controller": "12.0.1-preview-fcaebe2b",
  "@metamask-previews/preferences-controller": "15.0.0-preview-fcaebe2b",
  "@metamask-previews/profile-sync-controller": "2.0.0-preview-fcaebe2b",
  "@metamask-previews/queued-request-controller": "8.0.0-preview-fcaebe2b",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-fcaebe2b",
  "@metamask-previews/remote-feature-flag-controller": "1.0.0-preview-fcaebe2b",
  "@metamask-previews/selected-network-controller": "20.0.0-preview-fcaebe2b",
  "@metamask-previews/signature-controller": "23.0.0-preview-fcaebe2b",
  "@metamask-previews/transaction-controller": "41.0.0-preview-fcaebe2b",
  "@metamask-previews/user-operation-controller": "20.0.0-preview-fcaebe2b"
}

@jiexi
Copy link
Contributor Author

jiexi commented Dec 2, 2024

@metamaskbot publish-previews

Copy link
Contributor

github-actions bot commented Dec 2, 2024

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": "20.0.0-preview-31564566",
  "@metamask-previews/address-book-controller": "6.0.1-preview-31564566",
  "@metamask-previews/announcement-controller": "7.0.1-preview-31564566",
  "@metamask-previews/approval-controller": "7.1.1-preview-31564566",
  "@metamask-previews/assets-controllers": "45.1.0-preview-31564566",
  "@metamask-previews/base-controller": "7.0.2-preview-31564566",
  "@metamask-previews/build-utils": "3.0.1-preview-31564566",
  "@metamask-previews/chain-controller": "0.2.0-preview-31564566",
  "@metamask-previews/composable-controller": "9.0.1-preview-31564566",
  "@metamask-previews/controller-utils": "11.4.3-preview-31564566",
  "@metamask-previews/ens-controller": "15.0.0-preview-31564566",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-31564566",
  "@metamask-previews/gas-fee-controller": "22.0.1-preview-31564566",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-31564566",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-31564566",
  "@metamask-previews/keyring-controller": "19.0.0-preview-31564566",
  "@metamask-previews/logging-controller": "6.0.2-preview-31564566",
  "@metamask-previews/message-manager": "11.0.1-preview-31564566",
  "@metamask-previews/multichain": "1.1.0-preview-31564566",
  "@metamask-previews/name-controller": "8.0.1-preview-31564566",
  "@metamask-previews/network-controller": "22.0.2-preview-31564566",
  "@metamask-previews/notification-services-controller": "0.14.0-preview-31564566",
  "@metamask-previews/permission-controller": "11.0.3-preview-31564566",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-31564566",
  "@metamask-previews/phishing-controller": "12.3.0-preview-31564566",
  "@metamask-previews/polling-controller": "12.0.1-preview-31564566",
  "@metamask-previews/preferences-controller": "15.0.0-preview-31564566",
  "@metamask-previews/profile-sync-controller": "2.0.0-preview-31564566",
  "@metamask-previews/queued-request-controller": "8.0.0-preview-31564566",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-31564566",
  "@metamask-previews/remote-feature-flag-controller": "1.0.0-preview-31564566",
  "@metamask-previews/selected-network-controller": "20.0.0-preview-31564566",
  "@metamask-previews/signature-controller": "23.0.0-preview-31564566",
  "@metamask-previews/transaction-controller": "41.0.0-preview-31564566",
  "@metamask-previews/user-operation-controller": "20.0.0-preview-31564566"
}

expect(mockSubscriptionManager.destroy).toHaveBeenCalled();
});

it('should unsubscribe when the middleware is destroyed', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be an assertion in this test about the state of subscriptions? Or I suppose you can't access this 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Like you said, it's private so you can't actually check the internal state

Copy link
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

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

LGTM

@jiexi jiexi marked this pull request as ready for review December 2, 2024 20:13
@jiexi jiexi requested a review from a team as a code owner December 2, 2024 20:13
@jiexi jiexi merged commit 57e6ab5 into caip-multichain-api Dec 2, 2024
4 checks passed
@jiexi jiexi deleted the jl/caip-multichain/subscription-middleware-destroy branch December 2, 2024 20:16
jiexi added a commit to MetaMask/metamask-extension that referenced this pull request Dec 2, 2024
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

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

## **Related issues**

Core: MetaMask/core#4984

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

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

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] 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).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] 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.

---------

Co-authored-by: MetaMask Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants