refactor(events): improve adapter semantics and typing#721
Closed
aXenDeveloper wants to merge 15 commits into
Closed
refactor(events): improve adapter semantics and typing#721aXenDeveloper wants to merge 15 commits into
aXenDeveloper wants to merge 15 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
What did you do, omg 😱 |
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.
Summary
Improves the Events API introduced in #720 while keeping the existing public configuration compatible.
Changes
failedemit status for adapter publish failures instead of reporting them asdelivered.AnyEventEnvelope, a discriminated union of all registered event envelopes, so custom adapters can narrow payload types fromenvelope.name.EventsAdapter.EventsApiPluginas a deprecated compatibility alias to avoid breaking existing integrations.Why
The previous result status could report
deliveredeven when the transport failed before delivering anything. The generic envelope type also lost the relationship between an event name and its payload inside adapter implementations.Non-goals
This PR does not introduce distributed delivery, retries, persistent event storage, transaction hooks, or the outbox pattern.
Validation
The diff is intentionally limited to the event model and local adapter. Automated repository checks should validate formatting, type safety, and tests on the PR.