Skip to content

OBJ-99 — Share events fire INotificationSink - #40

Merged
objectgyan merged 1 commit into
mainfrom
objectgyan/obj-99-m9b4-share-events-fire-inotificationsink
May 17, 2026
Merged

objectgyan merged 1 commit into
mainfrom
objectgyan/obj-99-m9b4-share-events-fire-inotificationsink

Conversation

@objectgyan

Copy link
Copy Markdown
Owner

Summary

  • Wire share.granted emission into ShareService.GrantAsync (OBJ-96 path)
  • Wire share.revoked emission into ShareService.RevokeAsync (OBJ-96 path)
  • Wire share.link_issued emission into ShareTokenService.CreateAsync (OBJ-97 path)

Details

Both ShareService and ShareTokenService now accept INotificationSink via constructor injection and call _ = _notificationSink.SendAsync(new NotificationEvent(...)) fire-and-forget after each successful DB write. The NotificationDispatcher (OBJ-86) swallows per-sink exceptions so a failing sink never breaks the originating grant/revoke/issue operation.

Test plan

  • 5 new unit tests in ShareNotificationTests.cs: each event type produces exactly one sink call with the correct payload; throwing sink does not break operation
  • 165/165 unit tests pass
  • 122/122 integration tests pass
  • scripts/validate-obj-99.ps1 exits 0: live API log grepped for all three notification lines

Wire share.granted / share.revoked / share.link_issued notification emission
into ShareService (OBJ-96 paths) and ShareTokenService (OBJ-97 path).
Dispatch is fire-and-forget via NotificationDispatcher; throwing sinks are
swallowed. Add 5 unit tests covering all three event types and resilience.
@linear-code

linear-code Bot commented May 17, 2026 •

Copy link
Copy Markdown
OBJ-99 M9b.4 — Share events fire `INotificationSink`

Milestone: M9 · Wave: 3

Summary

On grant, revoke, and tokenized-link issuance, fire INotificationSink with a share.* event so hosts can email/notify recipients.

Acceptance

  • Three event types emitted: share.granted, share.revoked, share.link_issued
  • Payload includes document id, grantee (when applicable), role, expiry
  • Sink is async + failures logged but do not break the write

Validation

  • DB check: N/A (callback)
  • Live API check: trigger grant → console-sink line shows expected payload
  • Script: scripts/validate-obj-NNN.ps1

Branch / PR

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

Review in Linear

@objectgyan
objectgyan merged commit e1780dc into main May 17, 2026
2 of 4 checks passed
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