-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Handle non-String web3 property access #9256
Conversation
Builds ready [7ff6754]
Page Load Metrics (642 ± 78 ms)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic find!
One nit, non-blocking.
app/scripts/lib/setupWeb3.js
Outdated
const name = typeof key === 'string' | ||
? key | ||
: `typeof ${typeof key}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably DRY this up, but I'm not gonna block on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
The web3 usage metrics added in #9144 assumed that all web3 properties were strings. When a `Symbol` property is accessed, our `inpage.js` script crashes because the `Symbol` cannot be serialized correctly. A check has been added for non-string property access. The metric event in these cases is set to the string "typeof ", followed by the type of the key. (e.g. `typeof symbol` for a `Symbol` property). Fixes #9234
7ff6754
to
8197349
Compare
Builds ready [8197349]
Page Load Metrics (625 ± 45 ms)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 👍
The web3 usage metrics added in #9144 assumed that all web3 properties were strings. When a `Symbol` property is accessed, our `inpage.js` script crashes because the `Symbol` cannot be serialized correctly. A check has been added for non-string property access. The metric event in these cases is set to the string "typeof ", followed by the type of the key. (e.g. `typeof symbol` for a `Symbol` property). Fixes #9234
The web3 usage metrics added in #9144 assumed that all web3 properties were strings. When a
Symbol
property is accessed, ourinpage.js
script crashes because theSymbol
cannot be serialized correctly.A check has been added for non-string property access. The metric event in these cases is set to the string "typeof ", followed by the type of the key. (e.g.
typeof symbol
for aSymbol
property).Fixes #9234