Skip to content

OBJ-86 — INotificationSink contract + console-sink default - #32

Merged
objectgyan merged 1 commit into
mainfrom
objectgyan/obj-86-m56-inotificationsink-contract-console-sink-default
May 17, 2026
Merged

objectgyan merged 1 commit into
mainfrom
objectgyan/obj-86-m56-inotificationsink-contract-console-sink-default

Conversation

@objectgyan

Copy link
Copy Markdown
Owner

Summary

  • Replaces NoOpNotificationSink stub (OBJ-85) with ConsoleNotificationSink + NotificationDispatcher
  • Dispatcher fans out concurrently to all registered INotificationSinkHandler sinks; per-sink exceptions are caught, logged at Error level, and swallowed — a failing sink never breaks the originating write
  • AddNotificationSink<T>() DI extension registers a concrete sink and wires the dispatcher as the single INotificationSink; multiple calls add multiple sinks
  • comment.replied event wired into CreateReplyAsync path (fires after DB commit)

Test plan

  • Build passes (0 warnings, TreatWarningsAsErrors=true)
  • 159 unit tests pass (7 new: ConsoleNotificationSink, dispatcher fan-out, throwing-sink resilience, payload capture)
  • 81 integration tests pass (existing MentionApiTests + CommentApiTests)
  • scripts/validate-obj-86.ps1 exits 0: greps API stdout for mention.created and comment.replied log lines; confirms DB rows

Replace NoOpNotificationSink stub (OBJ-85) with ConsoleNotificationSink +
NotificationDispatcher. The dispatcher fans out concurrently to all registered
INotificationSinkHandler sinks; per-sink exceptions are caught, logged, and swallowed
so a failing sink never breaks the originating write. DI extension
AddNotificationSink<T>() registers a concrete sink and wires the dispatcher as the
single INotificationSink. comment.replied event wired into CreateReplyAsync path.
@linear-code

linear-code Bot commented May 17, 2026 •

Copy link
Copy Markdown
OBJ-86 M5.6 — `INotificationSink` contract + console-sink default

Milestone: M5 · Wave: 2

Summary

Define INotificationSink.SendAsync(NotificationEvent) so the host can wire email/Slack/etc. Default ConsoleNotificationSink writes to logs. Fires on mention.created and comment.replied.

Acceptance

  • Interface + default impl + DI extension AddNotificationSink<T>()
  • Mention/reply paths call the sink
  • Unit tests assert sink is invoked with expected payload

Validation

  • DB check: N/A (sink is a callback)
  • Live API check: trigger a mention → API logs show console-sink line with expected fields
  • Script: scripts/validate-obj-NNN.ps1 greps logs for the sink output

Branch / PR

Branch from main; target main. No trailers/footer.

Review in Linear

@objectgyan
objectgyan merged commit bbfa478 into main May 17, 2026
2 of 3 checks passed
objectgyan added a commit that referenced this pull request May 17, 2026
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.

1 participant