Skip to content

Conversation

danieldaquino
Copy link
Collaborator

This PR:

  1. Updates the nostr-tools package to give us SimplePool.
  2. Uses SimplePool instead of the lower-level Relay object, as recommended by the nostr-tools documentation.
  3. Keeps the SimplePool instance active on the app singleton object to avoid constant reconnection to relays.

This is an attempt to fix damus-io/website#42, based on the investigation done there.

This is a tentative fix based off of an analysis of the logs, the report, and the code. The issue could not be definitively reproduced on a controlled setup, so this fix cannot be guaranteed to fix the issue in question, but has a good probability of fixing it.

Testing:

api: 38b3000
website: 322171d3f9a8c92568b822c54568021495d767e2
Setup: Local frontend and backend

Steps:

  1. Login via the website. Ensure login works.
  2. Go through the purple checkout process (using Nostr DMs). Ensure it works.
  3. Move .env to a separate file, then run npm test. Ensure tests pass.

PASS

This commit changes web_auth.js to use `SimplePool` instead of direct
relay objects, as recommended by the `nostr-tools` documentation, to
handle relay connections more automatically and prevent issues such as
errors due to the connection getting closed, or other such relay pool
management responsibilities.

Closes: damus-io/website#42
Signed-off-by: Daniel D’Aquino <[email protected]>
Signed-off-by: Daniel D’Aquino <[email protected]>
@danieldaquino
Copy link
Collaborator Author

@jb55, please let me know if you have any questions or suggestions, thank you.

@danieldaquino
Copy link
Collaborator Author

CI tests passing, it looks failed because of this known issue: #10

# { total: 547, pass: 547 }
# time=41103.612ms
Error: Process completed with exit code 1.

@jb55
Copy link
Contributor

jb55 commented Apr 24, 2025 via email

@danieldaquino
Copy link
Collaborator Author

@jb55, for some reason I cannot merge this PR, the button no longer shows up for me and I can't merge via the command-line. Maybe some Github setting was changed. Can you please check?

@jb55
Copy link
Contributor

jb55 commented Apr 25, 2025

I'll check, my bad

@jb55
Copy link
Contributor

jb55 commented Apr 30, 2025

@danieldaquino you should have access now

@danieldaquino
Copy link
Collaborator Author

@danieldaquino you should have access now

Thanks!

@danieldaquino danieldaquino merged commit c2a6df6 into damus-io:master May 2, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Continue button on login occasionally does nothing

2 participants