nostr-rs-relay
nostr-rs-relay copied to clipboard
OK message for ephemeral events
It seems like an OK message is only send for events that are persisted, not for ephemeral events. This is concluded from testing with nip47 request and response events and from seeing the following issue for nip42 that also uses ephemeral events: https://github.com/scsibug/nostr-rs-relay/issues/213
As NIP01 describes, all events should be acknowledged or denied by an OK message, so that also includes ephemeral events, as other relays do.
OK messages MUST be sent in response to EVENT messages received from clients, they must have the 3rd parameter set to true when an event has been accepted by the relay, false otherwise.
Ah this is probably why noStrudel thinks my relay never posts my stuff, even though it does.
@scsibug I am interested in fixing this issue, can you point me?
https://github.com/scsibug/nostr-rs-relay/blob/a6b48620fdd343fa7088a8b5f5a69ce8ab102eba/src/db.rs#L395-L406
Lines 395 to 406 in a6b4862
if event.is_ephemeral() { bcast_tx.send(event.clone()).ok(); debug!( "published ephemeral event: {:?} from: {:?} in: {:?}", event.get_event_id_prefix(), event.get_author_prefix(), start.elapsed() ); event_write = true; // send OK message notice_tx.try_send(Notice::saved(event.id)).ok();
So it sends it, why is this issue faced us?
So it sends it, why is this issue faced us?
Somebody needs to debug this