aepp-sdk-js icon indicating copy to clipboard operation
aepp-sdk-js copied to clipboard

Is it necessary to call `shareWalletInfo` all the time?

Open davidyuk opened this issue 5 years ago • 9 comments

Right now, the example wallet sends to aepp walletInfo messages 5 times with an interval of 5 seconds. Are these messages necessary for aepp to work? If yes then in general case, it seems not enough because we can't track navigations in an iframe, so the user might switch between aepps at any time, which makes the wallet to poll iframe with walletInfo messages all the time. Can aepp initialize the connection to the wallet by itself as it was before?

davidyuk avatar Feb 19 '20 08:02 davidyuk

Also, can this polling part be moved to the sdk side?

davidyuk avatar Feb 19 '20 08:02 davidyuk

Should interval be decreased to something like 1 second to speedup wallet detection?

davidyuk avatar Feb 19 '20 09:02 davidyuk

Should interval be decreased to something like 1 second to speedup wallet detection?

you have full control over this

nduchak avatar Feb 19 '20 10:02 nduchak

Are these messages necessary for aepp to work? If yes then in general case, it seems not enough because we can't track navigations in an iframe, so the user might switch between aepps at any time, which makes the wallet to poll iframe with walletInfo messages all the time

We can track the navigation in Aepp stamp and then trigger the onDisconnect message to wallet where you can start control polling. The things is that one approach should work the same for all of the cases(extension, iframe/reverse iframe), and for extension wallet it's not possible to AEPP connection initialization because the runtime.id is required for that

nduchak avatar Feb 19 '20 10:02 nduchak

you have full control over this

Have you tried to find the best decision? It looks like a controversial issue caused by a wrong architectural decision on the sdk side.

We can track the navigation in Aepp stamp and then trigger the onDisconnect message to wallet where you can start control polling.

What if user switcher from a usual web site to aepp? This can happen at an arbitrary moment, can we track it somehow without polling?

The things is that one approach should work the same for all of the cases

why we can't use a bit different (and much more efficient) protocol in the iframe case? Anyway, aepp sees the difference between sending messages to a parent frame or to an extension.

davidyuk avatar Feb 24 '20 08:02 davidyuk

I want to notice that the wallet team considered default behavior as a bug and has switched to infinite pooling. I'm proposing to update the sdk examples accordingly.

davidyuk avatar May 18 '20 07:05 davidyuk

@davidyuk Is there a chance to make any progress on this issue in the near future? There are a lot of aepps where it's clear that something is wrong:

  • Logging to jelly swap takes long using SH
  • People complain on the forum: https://forum.aeternity.com/t/most-dapps-running-on-aeternity-can-t-log-in-smoothly/8130/5
  • etc...

gorbak25 avatar Nov 20 '20 12:11 gorbak25

@davidyuk Any progress on this?

gorbak25 avatar Jan 23 '21 11:01 gorbak25

No, I don't have.

davidyuk avatar Jan 26 '21 06:01 davidyuk