I have to decide on how to handle this edge case in the rely framework I am building:

1. a client sends a REQ

2. a client sends an EVENT that matches the REQ

Should I return the event or not? The following is a screenshot of a khatru relay, that returns the event.

#asknostr

I think there is a real world pattern in support of returning it: a lot of people follow themselves to have feedback on whether their posts were successfully stored on the relay.

Reply to this note

Please Login to reply.

Discussion

You should return it, also helps to keep things simple. Instead of having to keep track of which ws client sent the event and then omitting it, just return it to all ws clients with subscriptions that match the filter

This 👆

actually, in my design this doesn't add any complexity, it's just an if statement.

I do this to test note propagation.

Yeah, I think not returning it would confuse users and clients of the relay

I have some relays who refuse to return and I'm like

It seems a bit wasteful, no? The "OK" reply with the true value is already a signal to the client that the event was stored.

I don't always return it, I return it only when the client has a REQ that matches it. It is more wasteful, but It's more important to match the user's expectations