nostr-rs-relay icon indicating copy to clipboard operation
nostr-rs-relay copied to clipboard

OK message for ephemeral events

Open kumulynja opened this issue 1 year ago • 5 comments

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.

kumulynja avatar Nov 21 '24 11:11 kumulynja

Ah this is probably why noStrudel thinks my relay never posts my stuff, even though it does.

Sjors avatar Jan 20 '25 20:01 Sjors

@scsibug I am interested in fixing this issue, can you point me?

TheAwiteb avatar Feb 08 '25 21:02 TheAwiteb

https://github.com/scsibug/nostr-rs-relay/blob/a6b48620fdd343fa7088a8b5f5a69ce8ab102eba/src/db.rs#L395-L406

v0l avatar Feb 09 '25 14:02 v0l

nostr-rs-relay/src/db.rs

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?

TheAwiteb avatar Feb 09 '25 15:02 TheAwiteb

So it sends it, why is this issue faced us?

Somebody needs to debug this

v0l avatar Feb 12 '25 11:02 v0l