MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.57k stars 4.73k forks source link

[Bug]: MV3 - Forcing Service Worker to stop throws error and MM stays loading `app-init.js:1 Dropped attempt to register inpage content script. Error: Duplicate script ID 'inpage'` #24514

Closed seaona closed 1 week ago

seaona commented 2 weeks ago

Describe the bug

[Edit] This behaviour has been identified also in cases where I didn't stop the service worker manually (see below comment).

Whenever I force the service worker to stop manually, I see the error app-init.js:1 Dropped attempt to register inpage content script. Error: Duplicate script ID 'inpage'and when I try to perform any action/refresh MM, I see that the wallet stays loading indefinitely.

To fix it, you need to click the Reload MM button.

Adding a Sev3 label, since I'm not sure in which situation this would happen, aside from manually stopping it.

Expected behavior

No response

Screenshots/Recordings

https://github.com/MetaMask/metamask-extension/assets/54408225/bd3c26c0-495e-4744-9820-7a071277a35d

Steps to reproduce

  1. Start MM MV3 build
  2. Go to chrome://serviceworker-internals/?devtools
  3. Stop Service Worker manually with the button
  4. Refresh MM
  5. See how it stays loading indefinetly

Error messages or log output

No response

Version

develop MV3 build

Build type

None

Browser

Chrome

Operating system

Linux

Hardware wallet

No response

Additional context

No response

Severity

No response

seaona commented 2 weeks ago

I've encountered this issue x2 more times, this case I haven't stopped the service worker manually. Just trying to open the MM popup and it stayed loading forever.The only way to recover is by clicking reload the app.

With this new finding, I'm bumping this to a sev-2 and possibly we need to re-evaluate if it's an MV3 blocker cc @danjm @gauthierpetetin I've encountered it when I leave the MM for some time idle and then try to open the pop

https://github.com/MetaMask/metamask-extension/assets/54408225/f5680232-7938-433a-b716-640b63b7ee98

danjm commented 1 week ago

I'm looking at this now. It is definitely a blocker