Skip to content

feat: return matched destinations in publish api#669

Merged
alexluong merged 1 commit into
mainfrom
publish-matched-destinations
Feb 6, 2026
Merged

feat: return matched destinations in publish api#669
alexluong merged 1 commit into
mainfrom
publish-matched-destinations

Conversation

@alexluong

@alexluong alexluong commented Feb 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add destination_ids field to the publish response (HandleResult) so callers know which destinations an event was routed to
  • Returns [] (empty array, never null) when no destinations match
  • OpenAPI spec updated; unit + e2e test coverage added

No changes to the Event model 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.Event currently 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 single events table (just gets the new column) — the separation is code-only.

Naming ideas:

Input struct Persisted struct Notes
Event EventRecord Minimal churn — Event stays as-is, new struct only where needed (logstore, read APIs)
PublishEvent Event More natural: Event becomes 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.

@vercel

vercel Bot commented Feb 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
outpost-docs Ready Ready Preview, Comment Feb 2, 2026 3:05pm
outpost-website Ready Ready Preview, Comment Feb 2, 2026 3:05pm

Request Review

@vercel vercel Bot temporarily deployed to Preview – outpost-docs February 1, 2026 12:01 Inactive
Base automatically changed from refactor-auth to main February 2, 2026 14:16
@alexluong alexluong force-pushed the publish-matched-destinations branch from 700108e to aef2991 Compare February 2, 2026 15:04
@vercel vercel Bot temporarily deployed to Preview – outpost-docs February 2, 2026 15:05 Inactive
@vercel vercel Bot temporarily deployed to Preview – outpost-website February 2, 2026 15:05 Inactive
@alexluong alexluong merged commit d653ac7 into main Feb 6, 2026
5 checks passed
@alexluong alexluong deleted the publish-matched-destinations branch February 6, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants