feat: return matched destinations in publish api #669
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.
Summary
destination_idsfield to the publish response (HandleResult) so callers know which destinations an event was routed to[](empty array, never null) when no destinations matchNo changes to the
Eventmodel or persistence layer — this is response-only.Next: persistence
We need to persist
destination_ids— it captures a point-in-time routing decision that can't be reliably reconstructed later (destinations can be added, removed, or disabled after publish).Approach: separate input from persisted state in Go code
models.Eventcurrently maps 1:1 to the publish input. Rather than bolting computed fields onto it, we'll introduce a separate Go struct for the persisted/output representation. The DB stays as a singleeventstable (just gets the new column) — the separation is code-only.Naming ideas:
EventEventRecordEventstays as-is, new struct only where needed (logstore, read APIs)PublishEventEventEventbecomes the richer DB type, publish input gets the narrower name. More disruptive rename.The persisted struct would embed or compose the input struct, adding fields like
DestinationIDs []string.Decision needed on naming before implementing.