fix: Make WebSocket event ingest idempotent#28
Conversation
|
Thanks @Adarsh9977 for the clean fix, merging it. One follow-up: the path is idempotent for the events row but not end to end. On a retry the classifier re-runs and writes a second row for the same event_id, so replays quietly duplicate verdicts and repeat inference. If you want to take it, have InsertEvent report whether it actually inserted (RowsAffected() == 0 means duplicate), and on a duplicate skip classify plus the verdict insert and re-publish the existing verdict. Same tests should pass. Also, while you're at it: Merging now, follow-up is welcome but not required. |
Thanks @shahtajkhalid, I'll update it and open a PR shortly |
Summary
event_idinserts during event ingest so SDK retry frames do not close the WebSocket.Test plan
go test ./internal/wsChecklist