Repository navigation
refactor(messaging): align message update params with create - #13959
Conversation
The email, SMS and push update endpoints declared content, topics, users and targets in a different order than their create siblings, so the generated SDKs exposed two different signatures for the same fields. This reorders the generated SDK arguments for updateEmail, updateSms and updatePush.
🟢 Tier S · Ready to merge
Reorders the email, SMS, and push message update parameters to match their create counterparts. Each update action signature follows its new route parameter order; validators and defaults remain unchanged.
📂 Walkthrough · 3
Reviewed |
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
What does this PR do?
The create and update message endpoints declared their parameters in different orders. On main all three pairs diverge, even though the parameter set is identical in each pair — it is a pure permutation:
messageId subject content topics users targets cc bcc …messageId topics users targets subject content draft html cc bcc …messageId content topics users targets draft scheduledAtmessageId topics users targets content draft scheduledAtmessageId title body topics users targets data action …messageId topics users targets title body data action …This reorders the three
Update.phpparam chains, and theiraction()signatures, to match create.Update moves rather than create, and that direction is forced: the SDK generator stable-sorts spec params required-first. Email create declares
subject/contentas required immediately aftermessageId, so they are pinned to the front of every generated signature regardless of how the PHP file is written. Create is the fixed anchor; update is the side that can move. That also matches the issue, which presents create as the example and update as the deviation.Test Plan
composer linton all three changed files →{"tool":"pint","result":"passed"}eachNot run: no e2e. Message route coverage lives in
tests/e2e/Services/Messaging/MessagingBase.php, which has uncommitted work on another branch right now and was left untouched.Related PRs and Issues
This is a deliberate SDK-source break and wants a maintainer's call on timing. The HTTP wire contract does not change — Utopia resolves body values by name — but generated SDKs use positional arguments, so
updateEmail,updateSmsandupdatePushsignatures change in every SDK. This was scheduled for 1.6.0 on the issue; stable is now 2.3.0, so which release it rides in is not mine to decide. Nothing to regenerate in-repo: there is no checked-in spec directory, specs are built in CI.Checklist