Repository navigation
feat(messaging): migrate messaging service to the module structure - #13564
Merged
Merged
Conversation
Add Module.php, Services/Http.php, and the Providers group reference (Mailgun create/update, list, get, delete) as Action classes under the new module structure. Not yet registered in Appwrite.php; the old controller stays authoritative until the migration completes.
Add create/update actions for the FCM and APNS push providers, preserving their dual SDK Method arrays (deprecated lowercase + canonical uppercase names) verbatim, and register them in the module Http service.
Add create/update actions for the Sendgrid, SES, Resend and SMTP email providers and register them; SMTP keeps its dual SDK Method array (deprecated + canonical SMTP-cased names) verbatim.
Add create/update actions for the Msg91, Telesign, Textmagic, Twilio and Vonage SMS providers and register them in the module Http service.
Add CRUD actions for topics and the nested topic subscribers (create/list/get/delete) and register them in the module Http service.
Add email/sms/push message create+update, list, get, delete, and the nested message targets list, and register them. Push create/update carry their own private normalizeJsonObject (no shared global); FCM providers get the same private helper so they no longer depend on the controller's global that this migration removes.
Register Messaging\Module in the platform, flip the messaging service to 'controller' => '' so it is served by modules, and remove the legacy app/controllers/api/messaging.php now that all 46 routes are ported.
Contributor
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
abnegate
approved these changes
Sep 9, 2026
2 of 4 tasks
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
Migrates the entire Messaging service from the legacy monolithic controller (
app/controllers/api/messaging.php, ~4,556 lines) into the new module structure undersrc/Appwrite/Platform/Modules/Messaging/, following the same conventions as theFunctionsandDatabasesmodules.All 46 routes are ported as
Actionclasses. No public API change — paths, SDK method names/namespaces/groups, params, validators, labels, events, audits and response models are preserved verbatim.Structure
Type-specific creates/updates (providers by vendor, messages by channel) follow the existing
Databases/Columns/{Type}nesting pattern. Subscribers nest underTopics/, targets underMessages/, since they are child resources of those paths.How it was done
Committed in small, reviewable slices — one per resource group — so history reads as a progression rather than one 46-file drop:
Messaging\Module, flipservices.phpto'controller' => '', delete the old controllerThe module is only wired into the platform in the final commit, so no HTTP path is ever registered twice during the migration.
Notes on fidelity
Methodarrays preserved for FCM/APNS/SMTP/SMS, i.e. the deprecated lowercase name (createFcmProvider,createSms,createSmtpProvider) alongside the canonical uppercase one (createFCMProvider,createSMS,createSMTPProvider), including theDeprecatedblocks andpublic: false. This keeps generated SDKs and specs byte-for-byte compatible.normalizeJsonObjectwas a global function defined in the deleted controller. Per the reuse guidance (no globals, noHelperclasses), it is reintroduced as a small private method on the two Push message actions and the two FCM provider actions that use it — a little duplication over a shared global hook.getName()returns each route's existing SDK method name (unique per action); the publicsdklabel keeps the full (possibly dual)Methodset.Verification
Run locally and clean:
composer lintandcomposer analyze(PHPStan level 4) over the whole module andAppwrite.phpcomposer refactor:check(Rector)getName()s; no remaining references to the deleted controller or its globalRequires the container / CI (Swoole not available in a bare local CLI, so
app/cli.php specsand the boot path can't run here):php app/cli.php specs --version=latest --git=noproduces an unchanged spec diffdocker compose exec appwrite test tests/e2e/Services/MessagingRisk
Pure refactor. The main risk surface is (a) any route whose SDK metadata drifted during the port and (b) container boot / route registration — both covered by the spec-diff and e2e gates above, which should be green before merge.
🤖 Generated with Claude Code