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

OK message for ephemeral events #220

Open
kumulynja opened this issue Nov 21, 2024 · 5 comments
Open

OK message for ephemeral events #220

kumulynja opened this issue Nov 21, 2024 · 5 comments

Comments

@kumulynja
Copy link

kumulynja commented Nov 21, 2024

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: #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 kumulynja mentioned this issue Nov 21, 2024
@Sjors
Copy link

Sjors commented Jan 20, 2025

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

@TheAwiteb
Copy link

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

@v0l
Copy link
Contributor

v0l commented Feb 9, 2025

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();

@TheAwiteb
Copy link

TheAwiteb commented Feb 9, 2025

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?

@v0l
Copy link
Contributor

v0l commented Feb 12, 2025

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

Somebody needs to debug this

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

No branches or pull requests

4 participants