UTXOnly / nostpy-relay

A nostr relay backed by a postgresql database, run with docker-compose
The Unlicense
17 stars 6 forks source link

[BUG] No OK message returned for duplicate event #47

Closed UTXOnly closed 8 months ago

UTXOnly commented 8 months ago

Issue Relay should respond to client with OK message when there was an attempt to submit a duplicate event.

For example:

["OK", "b1a649ebe8...", true, "duplicate: already have this event"]

This relay currently only returns a 409 error to the websocket handler but does not provide the nostr client with any sort of response indicating if the event was successfully added or if an error occurred:

    except psycopg.IntegrityError as e:
        conn.rollback()
        return event_obj.evt_response(
            f"Event with ID {event_obj.event_id} already exists", 409
        )