getAlby / lightning-browser-extension

The Bitcoin Lightning Browser extension that connects to different wallet interfaces and brings deep lightning integration to the web
https://getalby.com
MIT License
530 stars 193 forks source link

Alby prompt keeps popping up on boltz.exchange #601

Closed MoritzKa closed 2 years ago

MoritzKa commented 2 years ago

If a user wants to do the off- to onchain swap on boltz.exchange/reverse, the user is asked to pay a lightning invoice. But the Alby prompt keeps popping up. As a result several (>20) Alby windows are open what makes the website not useable anymore. I noticed the there are only 4 Joule windows open. Zebedee, Strike or tippin.me did not react at all. image

dylancom commented 2 years ago

There seems to be some re-rendering bug on their end. Exactly on every second (when you see the expiration time updating) it calls webln.enable() & webln.sendPayment()

MoritzKa commented 2 years ago

so only webln provider extensions are affected then?

dylancom commented 2 years ago

Yes, I think Joule prevents spawning prompts somehow. To me it stops after 2 prompts show up.

MoritzKa commented 2 years ago

Yes it does. Maybe we can do that, too. But I will also contact boltz.exchange. Thanks for letting me know the cause.

dni commented 2 years ago

is this completely resolved?

bumi commented 2 years ago

It should be resolved, yes. Did you notice an issue? boltz still calls the webln functions too often (periodically), but Alby blocks those calls then

dni commented 2 years ago

i'm just thinking about improving boltz in that direction and stumbled upon this issue and was wondering if it is fixed now. polling to webln seems not ideal. i noticed i could not cancel the alby popup because it was constantly popping up again, which is kind of annoying.

bumi commented 2 years ago

yes, but why would one poll to webln? any webln resolves a promise or fails. for example:


webln.enable().then(() => {
  webln.makeInvoice(args).then((response) => {
    console.log(response.paymentRequest);
  });
});

no need to call makeInvoice multiple times.

See also: https://www.webln.guide/

With the change in this issue we try to prevent websites from calling multiple webln calls the same time.

dni commented 2 years ago

i have no clue, but thanks for that snippet, i see what i can do on that one