Skip to content

refactor(messaging): align message update params with create - #13959

Merged
HarshMN2345 merged 2 commits into
mainfrom
fix/issue-7919
Sep 28, 2026
Merged

HarshMN2345 merged 2 commits into
mainfrom
fix/issue-7919

Conversation

@HarshMN2345

Copy link
Copy Markdown
Member

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:

create update
Email messageId subject content topics users targets cc bcc … messageId topics users targets subject content draft html cc bcc …
SMS messageId content topics users targets draft scheduledAt messageId topics users targets content draft scheduledAt
Push messageId title body topics users targets data action … messageId topics users targets title body data action …

This reorders the three Update.php param chains, and their action() 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/content as required immediately after messageId, 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 lint on all three changed files → {"tool":"pint","result":"passed"} each
  • Confirmed each pair's parameter set is unchanged — only the order differs — so no validator, default or requiredness moves.

Not 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, updateSms and updatePush signatures 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

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs? — parameter order changes on three routes, so regenerated specs and SDKs are required before release

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.
@ghost

ghost commented Sep 28, 2026

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The reordered route parameters and action signatures match their create counterparts, with no unintended behavior change identified.

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.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 3
File Change
src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Update.php Moves subject, content, attachments, draft, and HTML into create-email order.
src/Appwrite/Platform/Modules/Messaging/Http/Messages/Push/Update.php Moves title and body ahead of recipient parameters.
src/Appwrite/Platform/Modules/Messaging/Http/Messages/Sms/Update.php Moves content ahead of recipient parameters.

Reviewed 7537eaf · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Reorders message update endpoint parameters.

No blocking issue was identified in the changes since the previous review; the PR appears safe to merge from this review.

Summary

The PR reorders the email, push, and SMS update-message parameters and handler signatures to match their create counterparts. The merge since the previous review did not change those three routes.

Reviews (2) · Last reviewed commit: "Merge branch 'main' into fix/issue-7919"

@HarshMN2345
HarshMN2345 merged commit fdb3311 into main Sep 28, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix/issue-7919 (after).

Metric Before After Change
🚀 Requests/sec 189.21 192.11 ⚪ +1.5%
⏱️ Latency P50 89.91 ms 89.95 ms ⚪ 0%
⏱️ Latency P95 218.54 ms 210.49 ms ⚪ -3.7%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 89.95 210.49 12,141 192.11 -8.05
Account 173.82 327.87 639 10.61 -14.65
TablesDB 86.82 163.54 6,603 107.22 -9.54
Storage 82.46 176.34 3,195 53.46 +1.55
Functions 128.23 250.27 1,704 29.06 -19.86

Top API waits (after)

API request Max wait (ms)
account.name.update 502.01
account.prefs.update 396.16
tablesdb.rows.create 394.7
tablesdb.rows.get 394.15
functions.create 386.07

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.

🚀 Enhancement: Make create/update email/push/sms endpoints consistent

1 participant