Skip to content

sending the same message with the same eventId results into a 500 error #1454

Closed
@michabbb

Description

@michabbb

Bug Report

Version

docker image: svix/svix-server:v1.36.0

Description

{{baseUrl}}/api/v1/app/:app_id/msg/?with_content=true

{
    "eventType": "something",
    "payload": {
    },
    "eventId": "b295a740-898f-41b9-bdd3-1157f3071a0c",
    "payloadRetentionPeriod": 90
}

sending this request twice leads to a 500 error and the logs show:

 ERROR HTTP request{http.versions=HTTP/1.1 http.host="xxxxxxxxxx:8071" http.method=POST http.route="/api/v1/app/:app_id/msg" http.target="/app/app_xxxxxxxxxxxxx/msg?with_content=true" http.user_agent="PostmanRuntime/7.42.0" otel.kind="server" request_id="2mi5gE8YvieebuP5FZcWMrbWdh7" org_id="org_xxxxxxxxxxx"}: svix_server::error: type: Conflict(Query(SqlxError(Database(PgDatabaseError { severity: Error, code: "23505", message: "duplicate key value violates unique constraint \"ix_message_uid_unique_app_cond\"", detail: Some("Key (app_id, uid)=(app_xxxxxxxxxx, b295a740-898f-41b9-bdd3-1157f3071a0c) already exists."), hint: None, position: None, where: None, schema: Some("public"), table: Some("message"), column: None, data_type: None, constraint: Some("ix_message_uid_unique_app_cond"), file: Some("nbtinsert.c"), line: Some(649), routine: Some("_bt_check_unique") })))), location: ["svix-server/src/v1/endpoints/message.rs:363:27"]

I would expect a regular result from the API with a return code like 409.
a return code 500 doesn´t say anything about the error 😏

Metadata

Metadata

Assignees

Labels

serverIssues regarding the server component

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions