Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with disconnecting relays [100,000 sats] #2072

Closed
alltheseas opened this issue Mar 19, 2024 · 18 comments
Closed

Issues with disconnecting relays [100,000 sats] #2072

alltheseas opened this issue Mar 19, 2024 · 18 comments
Assignees
Labels
1.7 bounty Sats bug Something is not working, or not working as intended meme relay

Comments

@alltheseas alltheseas added bug Something is not working, or not working as intended relay labels Mar 19, 2024
@alltheseas
Copy link
Collaborator Author

image

@alltheseas
Copy link
Collaborator Author

@karnagebitcoin
Copy link

I am in the same boat.

  1. Unable to edit relays in damus
  2. Deleted and reset all relays in Snort without forward slash
  3. Deleted Damus entirely
  4. Reinstalled Damus
  5. Got back in, see the same old relays

Is Damus caching my profile and fetching old relay selection? It seems to be the case. Despite having new updated relays, i'm still seeing the old ones, and this prevents me from doing anything on Damus other than reading notes.

@karnagebitcoin
Copy link

Adding 100,000 sat bounty to fix this.

@karnagebitcoin
Copy link

This seems to have happened with the update to 1.7x So.. whatever code difference was introduced there is probably the culprit.

@karnagebitcoin
Copy link

Update: I am able to add new relays, but I cannot delete the old ones. I also cannot click on them. It's as if they are in the "disabled" state and I can't interact with them. Trying to add the same relay gives me duplicate relay error.

@shawnyeager
Copy link

shawnyeager commented Mar 20, 2024

Shawn, here. This does seem to correspond with the 1.7 release. I’m experiencing the same problems as @karnagebitcoin notes:

  1. I’m unable to disconnect or delete relays.
  2. Relays with trailing slashes do not connect, but I can’t fix them in-app (see above).
  3. No relay changes made in Primal, Snort, or metadata.nostr.com reflect in Damus.

I am able to post.

@alltheseas alltheseas changed the title Issues with disconnecting relays Issues with disconnecting relays [100,000 sats] Mar 20, 2024
@alltheseas
Copy link
Collaborator Author

Report from a few weeks ago overlapping @shawnyeager and other ppl

#2024

@karnagebitcoin
Copy link

I was finally able to fix my relays but it was the weirdest experience that doesn't follow any logic. Here's what I did / happened:

  1. I noticed none of my relays were clickable, so I wasn't even able to disconnect them.
  2. Then I added nos.lol and was able to finally publish because this relay was not on my list but I was now connected.
  3. Then Will said I may be using npub to publish, so I logged out and made sure to log in with nsec again.
  4. Same issues persisted, but the app then crashed and logged me out entirely.
  5. Logged in with nsec again, now my relays were gone, all but one (nostr.band remained).
  6. I added other relays that were not in the list anymore. They worked and connected.
  7. Then the first relay I added (nos.lol) somehow got the trailing slash back and was "deactivated" same as other old relays.

That's it. Seems like the app crashing fixed the stuck relays. No idea how to replicate for you guys.

@danieldaquino danieldaquino self-assigned this Mar 20, 2024
@danieldaquino
Copy link
Contributor

I was able to replicate this issue (or at least part of the issue) locally based on the symptoms reported.

Issue repro

Device: iPhone 15 simulator
iOS: 17.4
Damus version: 1.8 (1) 247f313b (Current tip of the master branch)
Steps:

  1. Delete all connected relays
  2. Add wss://relay.damus.io/ (with the trailing slash) to the relay list
  3. Try removing this newly added relay.
  4. Try to post.

Results:
3. Relay cannot be removed from the list. (Did not work 2/2 times tried)
4. Posting does not work (Did not work 2/2 times tried)

Other data: Saw interesting app logs during this test, such as this one:

["EVENT",{"sig":"77696398abb490d3d097cd91af6545dc2a6e9c497a8c659e962ebd588d6204c140185c8ba65b1b9448116e92c2bdd7384360c4c870a26ffe97f831548788973a","id":"eafdfae115d8f2eb082371eff5dab4e70ed5eff6719f7e8c759ac64e9e9e2232","pubkey":"056b5b5966f500defb3b790a14633e5ec4a0e8883ca29bc23d0030553edb084a","created_at":1710948510,"content":"{}","tags":[["p","3efdaebb1d8923ebd99c9e7ace3b4194ab45512e2be79c1b7d68d9243e0d2681"],["p","056b5b5966f500defb3b790a14633e5ec4a0e8883ca29bc23d0030553edb084a"],["p","b9ceaeeb4178a549e8b0570f348b2caa4bef8933fe3323d45e3875c01919a2c2"]],"kind":3}]
attempt #7 to flush event '' to wss://relay.damus.io/ after 170.859375 seconds
could not find relay when flushing: wss://relay.damus.io/

I will start investigating the root cause.

@alltheseas
Copy link
Collaborator Author

Official bug meme dropped

image

@danieldaquino
Copy link
Contributor

I have a draft of the fix that seems to resolve this problem!

However, I modified code in several places (to prevent issues with trailing slashes in the future) so I should do more thorough testing before sending it over.

@jb55
Copy link
Collaborator

jb55 commented Mar 21, 2024 via email

@danieldaquino
Copy link
Contributor

Performed more thorough testing and sent the patch to patches@damus.io.

Code, discussion, and testing reports can all be found there (https://groups.google.com/a/damus.io/g/patches/c/GW34cPfIq2Y)

Please let me know if there are any concerns or questions!

Thank you!

@alltheseas
Copy link
Collaborator Author

Thank you @danieldaquino

@jb55 can we hot fix update the AppStore with this change alone?

@danieldaquino
Copy link
Contributor

@jb55 can we hot fix update the AppStore with this change alone?

I wrote and tested my changes on top of 1.8, but I can backport the changes to 1.7 if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7 bounty Sats bug Something is not working, or not working as intended meme relay
Projects
Status: In Review
Development

No branches or pull requests

5 participants