feat: ms.Notify — module-originated user notifications#130
Merged
Conversation
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>
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.
What
ms.Notify(ctx, ms.Notification{Title, Body, Icon, Link, Audience})lets a module land a notification in app members' inboxes:ms.NotifyAdmins(default) orms.NotifyAllMembers; the platform re-derives sender identity and expands recipients itself (envelope identity is never trusted).POST /apps/{appID}/notificationsingress (api-platform#285) with the same transport contract asms.Emit.dispatch_transport.go) used by Call/Emit/Notify — the #146 prod-transport swap has a single seam instead of three copies.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