Replies: 3 comments 2 replies
-
👍 I like this potential change because the method names seem a little more semantically accurate. I'm not thinking to myself "what is a consumer vs producer". |
Beta Was this translation helpful? Give feedback.
-
Agree with @nichoth |
Beta Was this translation helpful? Give feedback.
-
A few notes on how these interfaces compare in my mind. Managed interfaceThe alternative interface is more managed than the existing interface. Instead of creating an event emitter, one already exists on the program and you listen on it or request a link from it. One advantage to the managed interface is that it prevents you from accidentally creating more than one producer or consumer, which can result in unexpected behavior. Producer or consumer events?The existing interface is more explicit than the alternative interface. When you receive an event, you know for sure whether it is a producer or consumer event. With the alternative interface, you rely on the context of whether an active session exists or not. In theory, this should be fine. You can guard by checking for a session, and the session should only change after linking has completed and you call Stop/Cancel linkingOne thing we haven't outlined here is how to stop or cancel linking. In the existing interface, both the producer and consumer can cancel during linking by calling |
Beta Was this translation helpful? Give feedback.
-
We are evaluating the Webnative account linking interface and seeking feedback from developers.
Existing interface
Account linking in Webnative creates event emitters that listen for account linking events.
An
accountProducer
listens for a PIN from anaccountConsumer
and delegates the account when a user verifies the PINs match on both devices.The
accountConsumer
listens for similar events:Alternative interface
An alternative interface could move the account linking to
program.accountLinking
and change the way it works.A device with an existing session calls
program.accountLinking.listen
and listens for a PIN from a device that would like to be linked. It delegates the account when a user verifies the PINs match on both devices.A device that would like to be linked calls
program.accountLinking.link
and listens for similar messages.Beta Was this translation helpful? Give feedback.
All reactions