-
Notifications
You must be signed in to change notification settings - Fork 29
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
clients: Support Brave wallet default #411
Conversation
✅ Deploy Preview for oasisprotocol-sapphire-paratime canceled.
|
de0f2ec
to
60e355a
Compare
60e355a
to
9a0e4bf
Compare
One other solution mentioned would involve giving up the Proxy which currently prevents developers from accidentally double wrapping the |
Checking if @lukaw3d knows of a better magical JavaScript solution. 🙏🧙 |
It should be possible to remove the proxy contract and use some kind of WeakRef singleton for providers instead? Or... just don't do either. As long as there's a test for using double-wrapped providers to make sure they don't mess up encryption & decryption. |
Brave makes the upstream a Proxy. 😆 |
Can we do something like instead? return (...args) => Reflect.apply(value, upstream, args) Which will avoid the |
Uncaught (in promise) TypeError: 'get' on proxy: property 'removeListener' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected 'function(e,t){var n,r,i,o,s;if(u(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n...<omitted>...s}' but got '(...args) => Reflect.apply(value, upstream, args)')
... 😭 |
Still generates typeerror. Edit. I think the complication comes from the fact that |
9a0e4bf
to
25a992d
Compare
I think maintaining the Proxy object is a reasonable for now in order to support Brave or any other upstream that hijacks the |
25a992d
to
4fbd57c
Compare
0fe5314
to
e1d9092
Compare
e1d9092
to
3cc95f8
Compare
…z/fix-proxy-in-provider clients: Support Brave wallet default 88143e1
…/fix-proxy-in-provider clients: Support Brave wallet default 88143e1
Description
Close #385 maybe.
Problem
Wagmi is concerned with bad implementations of
EIP-1193
and wants to check that theremoveListener
function exists. However, the Brave wallet overridesethereum
properties and does not like the way we currently useProxy
objects, giving a typeerror upon aget
call.Our current implementation is a classic Proxy pattern in order to preserve
this
.simplified to:
sapphire-paratime/clients/js/src/provider.ts
Line 211 in 42c1a69
We can repro error via:
One solution is to not forward context in order to maintain the function signature for Brave browsers as noted in this PR.