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

[Sentry] TypeError: Attempted to assign to readonly property. #8015

Closed
sentry-io bot opened this issue Dec 6, 2023 · 1 comment · Fixed by #8033
Closed

[Sentry] TypeError: Attempted to assign to readonly property. #8015

sentry-io bot opened this issue Dec 6, 2023 · 1 comment · Fixed by #8033
Labels
area-Sentry Issue from Sentry regression-prod-7.12.0 regression-RC DEPRECATED: Please use "regresssion-RC-x.y.z" label instead regression-RC-7.13.0 release-7.13.0 Issue or pull request that will be included in release 7.13.0 release-7.16.0 Issue or pull request that will be included in release 7.16.0 release-blocker This bug is blocking the next release Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing team-security type-bug Something isn't working

Comments

@sentry-io
Copy link

sentry-io bot commented Dec 6, 2023

Sentry Issue: METAMASK-MOBILE-25WQ

TypeError: Attempted to assign to readonly property.
  at resolveEnsToIpfsContentId (app/lib/ens-ipfs/resolver.js:26:42)
  at resolveEnsToIpfsContentId (app/lib/ens-ipfs/resolver.js:71:2)
  at <global> (app/lib/ens-ipfs/resolver.js:11:56)
  at handleIpfsContent (app/components/Views/BrowserTab/index.js:470:38)
  at handleIpfsContent (app/components/Views/BrowserTab/index.js:531:6)
...
(45 additional frame(s) were not displayed)
@metamaskbot metamaskbot changed the title TypeError: Attempted to assign to readonly property. [Sentry] TypeError: Attempted to assign to readonly property. Dec 7, 2023
@metamaskbot metamaskbot added the area-Sentry Issue from Sentry label Dec 7, 2023
@sethkfman sethkfman added the Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing label Dec 7, 2023
@sethkfman sethkfman added release-blocker This bug is blocking the next release regression-RC DEPRECATED: Please use "regresssion-RC-x.y.z" label instead release-7.13.0 Issue or pull request that will be included in release 7.13.0 labels Dec 7, 2023
leotm added a commit that referenced this issue Jan 23, 2024
## **Description**

Fix recent spike in iOS crashes (sending ETH on Optimism)
and reenable SES on iOS (we disabled it temporarily for our v7.12.2
hotfix)
_nb: [flakey CI](#8046)
earlier was Node 18.19, not SES_

Make `regenerator-runtime@0.11.1` compatible with SES via a
[patch](c5eba9d)
(updated since to a resolution)
- refactor generator function prototype iterator symbol
- update object property assignment to `Object.defineProperty`

```console
...
├─┬ @metamask/assets-controllers@7.0.0
│ └─┬ babel-runtime@6.26.0
│   └── regenerator-runtime@0.11.1
...
```

<details><summary>full regenerator-runtime dep tree</summary>

```console
├─┬ @babel/runtime@7.23.2
│ └── regenerator-runtime@0.14.0
├─┬ @metamask/assets-controllers@7.0.0
│ └─┬ babel-runtime@6.26.0
│   └── regenerator-runtime@0.11.1
├─┬ @storybook/addon-knobs@5.3.21
│ └─┬ @storybook/api@5.3.21
│   └── regenerator-runtime@0.13.9 deduped
├─┬ @storybook/addon-ondevice-actions@6.5.6
│ └─┬ @storybook/addons@6.5.16
│   ├─┬ @storybook/api@6.5.16
│   │ └── regenerator-runtime@0.13.11 deduped
│   ├─┬ @storybook/router@6.5.16
│   │ └── regenerator-runtime@0.13.11
│   ├─┬ @storybook/theming@6.5.16
│   │ └── regenerator-runtime@0.13.11 deduped
│   └── regenerator-runtime@0.13.11
├─┬ @storybook/react-native@6.5.6
│ ├─┬ @storybook/client-api@6.5.16
│ │ ├─┬ @storybook/store@6.5.16
│ │ │ └── regenerator-runtime@0.13.11
│ │ └── regenerator-runtime@0.13.11
│ ├─┬ @storybook/core-client@6.5.16
│ │ ├─┬ @storybook/ui@6.5.16
│ │ │ ├─┬ @storybook/api@6.5.16
│ │ │ │ └── regenerator-runtime@0.13.11 deduped
│ │ │ ├─┬ @storybook/components@6.5.16
│ │ │ │ └── regenerator-runtime@0.13.11 deduped
│ │ │ ├─┬ @storybook/theming@6.5.16
│ │ │ │ └── regenerator-runtime@0.13.11 deduped
│ │ │ └── regenerator-runtime@0.13.11
│ │ └── regenerator-runtime@0.13.11
│ └─┬ @storybook/preview-web@6.5.16
│   └── regenerator-runtime@0.13.11
├─┬ appium@1.22.3
│ ├─┬ appium-android-driver@4.54.0
│ │ └─┬ jimp@0.16.2
│ │   ├─┬ @jimp/custom@0.16.2
│ │   │ └─┬ @jimp/core@0.16.2
│ │   │   └─┬ @jimp/utils@0.16.2
│ │   │     └── regenerator-runtime@0.13.11
│ │   └── regenerator-runtime@0.13.11
│ └─┬ appium-tizen-driver@1.1.1-beta.5
│   └─┬ jimp@0.5.6
│     └─┬ @babel/polyfill@7.12.1
│       └── regenerator-runtime@0.13.11
├─┬ react-native@0.71.14 invalid: "^0.0.0-0 || 0.60 - 0.70 || 1000.0.0" from node_modules/@react-native-async-storage/async-storage, "^0.56.0" from node_modules/react-native-jazzicon, "^0.62.2" from node_modules/react-native-v8
│ └── regenerator-runtime@0.13.11
└── regenerator-runtime@0.13.9
```

</details>

Considerations
- further patch `runtime.js` other relevant parts
- or resolve
`@metamask/assets-controllers>babel-runtime>regenerator-runtime`
- from v0.11.1 to v0.13.8+ (containing
[fix](facebook/regenerator@903a507))
- or resolve `@metamask/assets-controllers>babel-runtime`
- from v6.26.0 to
[v7.8.4](/~https://github.com/babel/babel/blame/9015fda3c106abda6928cf348797a38f09d4b3e0/packages/babel-runtime/package.json)+
(regenerator-runtime: ^0.13.2, which locks to 0.13.11)
- [ethjs patches](LavaMoat/docs#20) still
needed?

_Remaining `regenerator-runtime` transitive deps are safe above v0.13.8
(see dep tree above)_

## **Related issues**

Fixes: #8015

- https://metamask.sentry.io/issues/4699573603/?project=2299799 sev1
  - _app/lib/ens-ipfs/resolver.js26:42_ in `resolveEnsToIpfsContentId`
- `const Registry = contract(registryAbi).at(registryAddress);` an
ethjs/ethjs-contract
- _Suspect Commit:
b677fd9
update to `resolveEnsToIpfsContentId`_
- https://metamask.sentry.io/issues/4701946024/?project=2299799

<img width="661" alt="Screenshot 2023-12-07 at 4 03 00 pm"
src="/~https://github.com/MetaMask/metamask-mobile/assets/1881059/d92afd9d-ba11-453c-a8ad-fae043dd79d0">

Fixes: #8017

- https://metamask.sentry.io/issues/4702324986/?project=2299799

Additional context
- MetaMask/metamask-extension#10663
- endojs/endo#1855

## **Manual testing steps**

Steps in Sentry issue breadcrumbs (iOS prod)

To enable SES in debug-mode, omit `!__DEV__`


/~https://github.com/MetaMask/metamask-mobile/blob/46c1cea9328ff2a71bbbe98179af755c56385fd3/patches/react-native%2B0.71.14.patch#L11-L12

_I've not managed to repro locally this way yet_

## **Screenshots/Recordings**

### **Before**

### **After**

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](/~https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've clearly explained what problem this PR is solving and how it
is solved.
- [x] I've linked related issues
- [x] I've included manual testing steps
- [x] I've included screenshots/recordings if applicable
- [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-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
- [x] I’ve properly set the pull request status:
  - [x] In case it's not yet "ready for review", I've set it to "draft".
- [x] In case it's "ready for review", I've changed it from "draft" to
"non-draft".

## **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: Cal Leung <cleun007@gmail.com>
@metamaskbot metamaskbot added the release-7.16.0 Issue or pull request that will be included in release 7.16.0 label Jan 23, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity May 15, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team May 15, 2024
@tiagofilipenunes
Copy link

Observed this error on Sentry too, dapp is running wagmi 2.10.9. Error found on Safari iOS.

Failed here: https://app.carbondefi.xyz

{
arguments: [
{
message: Attempted to assign to readonly property.,
name: TypeError,
stack: Mo@https://app.carbondefi.xyz/assets/metamask-sdk-CDXQAocS.js:34:88014 init@https://app.carbondefi.xyz/assets/metamask-sdk-CDXQAocS.js:34:89669 @https://app.carbondefi.xyz/assets/metamask-sdk-CDXQAocS.js:35:3077 u@https://app.carbondefi.xyz/assets/metamask-sdk-CDXQAocS.js:16:37040
}
],
logger: console
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Sentry Issue from Sentry regression-prod-7.12.0 regression-RC DEPRECATED: Please use "regresssion-RC-x.y.z" label instead regression-RC-7.13.0 release-7.13.0 Issue or pull request that will be included in release 7.13.0 release-7.16.0 Issue or pull request that will be included in release 7.16.0 release-blocker This bug is blocking the next release Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing team-security type-bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants