v0l / snort

Feature packed nostr web UI, Mirror of https://git.v0l.io/Kieran/snort
https://snort.social
MIT License
321 stars 124 forks source link

Account switching does not work correctly #530

Closed mattn closed 1 year ago

mattn commented 1 year ago

Describe the bug

An error has occured!
{}

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://snort.social'
  2. Click on 'Logout'
  3. Login with NIP-07
  4. See that relay informations are empty
  5. Add new relay once
  6. See an error

Expected behavior

No errors

Desktop (please complete the following information):

Smartphone (please complete the following information):

I can't repro this on mobile phone

Additional context

As far as I can look, relay informations are not restored with logins.

mattn commented 1 year ago

Hmm, it seems that this occur only with my npub. Could you please login with my npub?

npub1937vv2nf06360qn9y8el6d8sevnndy7tuh5nzre4gj05xc32tnwqauhaj6

mattn commented 1 year ago

I tried to reproduce this with "yarn run start". But not reproduced.

v0l commented 1 year ago

I see the relays are not updating properly for other accounts, multi-account still needs a bit of work

mattn commented 1 year ago

I figure out why this occured.

Few weeks ago, I send DM to my self via my CLI tool. The message was broken as that kind is 4 but tags is empty. So snort raise an error when load DMs. Probably, recent changes make snort restrictly. I tried to delete the DM but wss://relay.snort.social does not behave deletion of DM with kind 5.

Could you please handle which one of two.

  1. support kind 5 for DM on relay.snort.social
  2. ignore broken DMs (ex: kind 4 but tags is empty)
mattn commented 1 year ago

Now I noticed that wss://relay.snort.social become payed relay. I can no longer log in to snort unless I delete the 4 broken DMs. please help @v0l

mattn commented 1 year ago

FYI, This unwrap raise an exception when the DM does not have any tags.

https://github.com/v0l/snort/blob/9258253f65583763793dae57fcc51d2f4d135a96/packages/app/src/Pages/MessagesPage.tsx#L107-L108