Skip to content

Cancelling inflight request during chainId change and useStaticTokenList flag change - #571

Merged
NiranjanaBinoy merged 2 commits into
mainfrom
abort-request
Aug 26, 2021
Merged

Cancelling inflight request during chainId change and useStaticTokenList flag change#571
NiranjanaBinoy merged 2 commits into
mainfrom
abort-request

Conversation

@NiranjanaBinoy

Copy link
Copy Markdown
Contributor

Using AbortController and AbortController.signal to cancel inflight requests to avoid fetching wrong data in case of chainId and useStaticTokenList change.

@NiranjanaBinoy NiranjanaBinoy self-assigned this Aug 25, 2021
@NiranjanaBinoy
NiranjanaBinoy requested a review from a team as a code owner August 25, 2021 16:05

@Cal-L Cal-L left a comment

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.

LGTM

@NiranjanaBinoy
NiranjanaBinoy merged commit 8428996 into main Aug 26, 2021
@NiranjanaBinoy
NiranjanaBinoy deleted the abort-request branch August 26, 2021 20:23
@adonesky1 adonesky1 mentioned this pull request Aug 27, 2021
rekmarks added a commit to MetaMask/metamask-extension that referenced this pull request Aug 31, 2021
Adds the latest version of `@metamask/controllers`, and updates our usage of the `ApprovalController`, which has been migrated to `BaseControllerV2`. Of [the new `controllers` release](https://github.com/MetaMask/controllers/releases/tag/v15.0.0), only the `ApprovalController` migration should be breaking.

This is the first time we use events on the `ControllerMessenger` to update the badge, so I turned the messenger into a property on the main `MetaMaskController` in order to subscribe to events on it in `background.js`. I confirmed that the badge does indeed update during local QA.

As it turns out, [MetaMask/core#571](MetaMask/core#571) was breaking for a single unit test case, which is now handled during setup and teardown for the related test suite (`metamask-controller.test.js`).
adonesky1 pushed a commit to MetaMask/metamask-extension that referenced this pull request Sep 17, 2021
Adds the latest version of `@metamask/controllers`, and updates our usage of the `ApprovalController`, which has been migrated to `BaseControllerV2`. Of [the new `controllers` release](https://github.com/MetaMask/controllers/releases/tag/v15.0.0), only the `ApprovalController` migration should be breaking.

This is the first time we use events on the `ControllerMessenger` to update the badge, so I turned the messenger into a property on the main `MetaMaskController` in order to subscribe to events on it in `background.js`. I confirmed that the badge does indeed update during local QA.

As it turns out, [MetaMask/core#571](MetaMask/core#571) was breaking for a single unit test case, which is now handled during setup and teardown for the related test suite (`metamask-controller.test.js`).
amitabh94 pushed a commit to amitabh94/core that referenced this pull request Jun 16, 2026
* 22.7.0

* chore: fix changelog

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Kevin Le Jeune <kevin.le-jeune@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants