Closed DanielUhlik closed 10 months ago
Hi, I'm not a kotlin dev but looking to the code seems that errors are not handled, so maybe the app crash for a malformed public key, timeouts or something else.
Are you able to add some try {} catch {}
where needed? And log the errors to see what's wrong.
These are some of the methods that could return an error:
Currently there are 2 values in the TagEnum that can refer to p
tag for contacts list: you have to check for both TagEnum.PubKey
and TagEnum.ContactList
. For next release I'll join them in a single one (TagEnum.PubKey
).
At this line miss a parenthesis:
val filter = Filter().kind(3u).pubkey(getPubKey()
Filter().pubkey(..)
search by p
tag. If you need to filter by event author, use Filter().author(...)
.
client.getEventsOf
subscribe and on EOSE close the subscription. If you need to keep open the subscription, use client.subscribe()
.
If you need to get events, but no need to wait for them, and handle them in client.handleNotifications
, you can use reqEventsOf(...)
. It's like the getEventsOf
(so close the subscription on EOSE) but spawn thread.
I started to write the book with all the docs for both kotlin and all the other supported langs. I hope to finish it soon.
Thank you, I can get follow list but I am still confused from some things. Kotlin docs will be helpful
Describe the bug
Subscribing to kind 3 events does nothing or crashes without error message:
To Reproduce
start()
: connect to relay, publish metadata event, subscribe to eventsaddContact("any_npub")
: create and publish kind 3 eventclass NostrRepository @Inject constructor() : CoroutineScope { private val keys by lazy { Keys.generate() }
}