Skip to content

feat: ms.Notify — module-originated user notifications#130

Merged
I-am-nothing merged 1 commit into
mainfrom
feat/notify
Jul 3, 2026
Merged

feat: ms.Notify — module-originated user notifications#130
I-am-nothing merged 1 commit into
mainfrom
feat/notify

Conversation

@I-am-nothing

Copy link
Copy Markdown
Contributor

What

ms.Notify(ctx, ms.Notification{Title, Body, Icon, Link, Audience}) lets a module land a notification in app members' inboxes:

  • Title/Body are i18n Labels resolved to per-locale maps AT SEND — the platform picks each recipient's language.
  • Audience is ms.NotifyAdmins (default) or ms.NotifyAllMembers; the platform re-derives sender identity and expands recipients itself (envelope identity is never trusted).
  • Envelope POSTs to the dispatch POST /apps/{appID}/notifications ingress (api-platform#285) with the same transport contract as ms.Emit.
  • The shared module→dispatch transport (base resolution, app-scope guard, POST + error contract) is now one file (dispatch_transport.go) used by Call/Emit/Notify — the #146 prod-transport swap has a single seam instead of three copies.
  • Template example (examples/template/notifications.go) + CHANGELOG entry; no VERSION bump (release later).

Testing

go build ./... && go vet ./... && go test ./... green (envelope contract pinned field-by-field, URL resolver table test, non-2xx truncation, validation-without-HTTP table); template example builds. Smoked against the live dev dispatch via the api-platform ingress tests.

🤖 Generated with Claude Code

ms.Notify(ctx, ms.Notification{...}) posts a notification envelope to
the platform dispatch (/apps/{appID}/notifications), mirroring ms.Emit's
transport exactly (shared callHTTP, ctx-derived app id, #146 prod seam
on the resolver, non-2xx -> truncated error). Title/Body are i18n Labels
resolved to per-locale maps at send so the platform renders each
recipient's language; audience is admins (default) or members — the
platform re-derives sender identity and expands recipients itself.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@I-am-nothing I-am-nothing merged commit 1a94250 into main Jul 3, 2026
1 check 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