Skip to content

fix(ray): merge follow-up payloads with the same uuid into the stored event - #396

Merged
butschster merged 1 commit into
masterfrom
fix/ray-same-uuid
Nov 7, 2026
Merged

butschster merged 1 commit into
masterfrom
fix/ray-same-uuid

Conversation

@butschster

Copy link
Copy Markdown
Member

Fixes #345.

ray('test')->trace(), ->color() and other chained calls send extra requests with the uuid of the first payload. The server stored each request as a new event, so the follow-ups failed on UNIQUE constraint failed: events.uuid and were lost.

Changes

  • event.Incoming.Merge (optional): a handler can fold a payload into a stored event with the same uuid and type instead of inserting a new one.
  • EventService.HandleIncoming: when Merge is set and the uuid is stored, update the payload (Store.UpdatePayload) and re-broadcast event.received; the UI replaces the event by uuid. Modules (webhooks) are not notified again. Merges are serialized, so follow-ups racing the first payload still land in one event.
  • Ray handler: follow-up payloads are appended to the stored ones; meta and the rest of the stored event are kept.

Tests

go test -race ./modules/ray/ ./internal/server/http/ ./internal/storage/ ./internal/metrics/; new TestRay_FollowUpMergesIntoEvent (log + trace + color → one event, three payloads) and TestRay_ConcurrentFollowUps (20 concurrent requests, one uuid → one event, 20 payloads).

Made with harnsy

… event

ray('x')->trace(), ->color() and other chained calls send extra requests
under the uuid of the first payload. They failed on the UNIQUE uuid and
were lost. Now their payloads are appended to the stored event, which is
re-broadcast so the UI replaces it. Merges are serialized, so follow-ups
racing the first payload still land in one event.

Fixes #345
@butschster butschster added type: bug Something is broken or behaves incorrectly module: ray Affects module: ray labels Nov 7, 2026
@butschster
butschster merged commit c412126 into master Nov 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: ray Affects module: ray type: bug Something is broken or behaves incorrectly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ray: associated data not working

1 participant