vitorpamplona / amethyst

Nostr client for Android
MIT License
1.17k stars 158 forks source link

[BUG] NWC Settings Not Saving #580

Open TonyGiorgio opened 1 year ago

TonyGiorgio commented 1 year ago

Describe the bug There's been a few times that NWC settings are not completely saving/persisting. Typically it's when there was one already.

To Reproduce Steps to reproduce the behavior:

  1. Have an NWC string already filled out
  2. Scan QR code
  3. Save
  4. Try to zap and see which one it goes to
  5. Sometimes close and reopen and it's a different one

When doing in the nostr deep link and there's already an NWC in there, it will act like it saves but it's still the old one.

Expected behavior When changing NWC, it should change.

Device (please complete the following information):

Bounty (in Bitcoin sats) offered for a solution None

OrigiSize commented 1 year ago

Is deleting the info and saving a workaround? If you can suggest another NWC-supporting service besides Alby, I'll try to test.

TonyGiorgio commented 1 year ago

No, because it's a silent amethyst error, the fault looks like it's on the NWC provider. So there's no indication that they need to manually delete it. Further, there's no easy way to manually delete.

https://app.mutinywallet.com/settings/connections?callbackUri=nostr&name=Amethyst

vitorpamplona commented 1 year ago

@TonyGiorgio can you check the URI you create when transferring back to Amethyst?

I am getting a nostr://, but it should be nostr+walletconnect:b889ff5b1513b64...

TonyGiorgio commented 1 year ago

@TonyGiorgio can you check the URI you create when transferring back to Amethyst?

I am getting a nostr://, but it should be nostr+walletconnect:b889ff5b1513b64...

The callback uri is whatever you set it in the URL. I guess for the above it would be

https://app.mutinywallet.com/settings/connections?callbackUri=nostr+walletconnect&name=Amethyst

Mistyped it. Though you should probably set it to be whatever amethyst is registered as if you want to ensure it comes back without needing user app selection.

vitorpamplona commented 1 year ago

Great, I got Amethyst to open the URI correctly. Now I am trying to reproduce this error.

On another note:

  1. is your relay replying with errors? I don't get anything when I don't have a balance.
  2. is it possible to solve the wallet is open on another tab issue? If I add the button to Mutiny, like Alby has, it always opens a new tab. So, it always crashes the wallet :(
TonyGiorgio commented 1 year ago

is your relay replying with errors? I don't get anything when I don't have a balance.

We don't support responding with balance

is it possible to solve the wallet is open on another tab issue? If I add the button to Mutiny, like Alby has, it always opens a new tab. So, it always crashes the wallet :(

If you have it installed as a PWA it might open up in that. Otherwise, the android app will handle that app link. But also just closing the existing tab should fix it. It's not safe to run in two tabs at the same time.

vitorpamplona commented 1 year ago

We don't support responding with balance

Not with a balance, but with an error saying that the person doesn't have a balance to pay the invoice. Right now I am not getting any error msg back to the app.

Otherwise, the android app will handle that app link.

Are you sure? I have it installed as a PWA, but the link always goes back to the browser. I am not sure how to make the PWA app open it form inside amethyst.

TonyGiorgio commented 1 year ago

Yeah our relay might not be responding with certain responses, can take a look at that.

The android native app should work, but yeah I guess the PWA might not be allowed to hijack app links like native apps can.

TonyGiorgio commented 7 months ago

This is still happening and it's causing confusion for Mutiny users.

https://github.com/MutinyWallet/mutiny-web/issues/1086