Repository navigation
fix(ray): merge follow-up payloads with the same uuid into the stored event - #396
Merged
Merged
Conversation
… 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
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 onUNIQUE constraint failed: events.uuidand 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: whenMergeis set and the uuid is stored, update the payload (Store.UpdatePayload) and re-broadcastevent.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.payloadsare appended to the stored ones;metaand the rest of the stored event are kept.Tests
go test -race ./modules/ray/ ./internal/server/http/ ./internal/storage/ ./internal/metrics/; newTestRay_FollowUpMergesIntoEvent(log + trace + color → one event, three payloads) andTestRay_ConcurrentFollowUps(20 concurrent requests, one uuid → one event, 20 payloads).Made with harnsy