fix: keep released SDK parameter order on messaging and OAuth2 updates by ChiragAgg5k · Pull Request #14467 · appwrite/appwrite · GitHub
Skip to content

fix: keep released SDK parameter order on messaging and OAuth2 updates - #14467

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix/sdk-param-order
Oct 14, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
fix/sdk-param-order

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

SDKs build positional arguments from the declared param order (required first, then optional). Several endpoints now declare params in a different order than the released SDKs, so the next SDK regeneration would silently shift existing positional calls:

// released
messaging.updateEmail(messageId, topics, users, targets, subject, content, ...)
// current main
messaging.updateEmail(messageId, subject, content, topics, users, targets, ...)
// → an existing call sends its topics as the subject
Endpoint Restored order (new params last)
messaging.updateEmail messageId, topics, users, targets, subject, content, draft, html, cc, bcc, scheduledAt, attachments, replyToEmail, replyToName
messaging.createEmail … attachments, draft, html, scheduledAt, replyToEmail, replyToName
messaging.updatePush messageId, topics, users, targets, title, body, … priority, channelId
messaging.updateSMS messageId, topics, users, targets, content, draft, scheduledAt
project.updateOAuth2{Auth0,Discord,GitHub,Microsoft,Okta,Salesforce,Zoho} … enabled, prompt
project.updateOAuth2Google clientId, clientSecret, prompt, enabled, nativeClientIds, nativeEnabled
project.updateOAuth2Apple serviceId, keyId, teamId, p8File, enabled, nativeClientIds, nativeEnabled

action()/handle() arguments are reordered to match, since route values are passed positionally. REST and GraphQL callers are unaffected (named fields).

Checked: every changed action's callback signature matches its declared params, Pint and PHPStan pass. Same class of fix as #14423.

Closes #14468

SDKs build positional arguments from the declared param order. New params
were declared ahead of params already in released SDKs, and the messaging
updates were reordered, so a regenerated SDK would shift existing
positional calls onto the wrong values.
@tenki-reviewer

tenki-reviewer Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review complete. No issues found — approved ✅.


This PR reorders route parameter declarations in the Messaging message endpoints (Email create/update, Push update, Sms update) and the OAuth2 provider update actions so that previously-positionally-required params like enabled and prompt can be made optional without forcing callers to pass them positionally. Parameter definitions and their corresponding action signatures were moved together, keeping name-based mapping intact and preserving required/optional flags and SDK-visible ordering.

Files Change
src/Appwrite/Platform/Modules/Messaging/Http/Messages/* Move draft, topicId, replyTo*, and scheduledAt param declarations so content/data ordering stays coherent in Email/Push/Sms create and update actions.
src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/* Reorder enabled, prompt, and credential params in the shared OAuth2 Base and Apple/Auth0/Google/Microsoft/Okta Update actions so enabled precedes prompt consistently across providers.

Reviewed commit: 97268f2

@hansi-codes

hansi-codes Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

🟢 Tier S · Ready to merge

Restores the released positional parameter order for messaging message actions and OAuth2 update actions. The associated callback signatures are reordered to keep route arguments aligned with the declared parameters.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 10
File Change
src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Create.php Moves reply-to parameters after the existing optional email creation parameters and aligns the callback.
src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Update.php Restores the released email update parameter sequence and aligns the callback.
src/Appwrite/Platform/Modules/Messaging/Http/Messages/Push/Update.php Moves title and body after recipient parameters and aligns the callback.
src/Appwrite/Platform/Modules/Messaging/Http/Messages/Sms/Update.php Moves content after recipient parameters and aligns the callback.
src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Apple/Update.php Places enabled before native client settings and aligns the handler.
src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Auth0/Update.php Places enabled before prompt and aligns the handler.
src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Base.php Declares enabled before prompt for inherited providers and aligns the shared callbacks.
src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Google/Update.php Places enabled before native client settings and aligns the handler.
src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Microsoft/Update.php Places enabled before prompt and aligns the handler.
src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Okta/Update.php Places enabled before prompt and aligns the handler.

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

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown

Security rules

No new WARNING or ERROR findings from security rules.

19 existing findings tracked in .semgrep/baseline.json
  • php.appwrite.guest-write-without-abuse-limit (12)
  • php.appwrite.secret-compare-timing (5)
  • php.appwrite.weak-secret-env-default (2)

Posted by Checks / Rules. Re-runs update this comment in place. Rule details and baseline: .semgrep/README.md.

@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix/sdk-param-order (after).

Metric Before After Change
🚀 Requests/sec 222.07 229.02 ⚪ +3.1%
⏱️ Latency P50 77.44 ms 74.98 ms ⚪ -3.2%
⏱️ Latency P95 181.07 ms 177.32 ms ⚪ -2.1%
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 74.98 177.32 14,307 229.02 -3.76
Account 151.15 286.14 753 12.47 +19.68
TablesDB 72.48 129.52 7,781 126.98 +4.56
Storage 69.57 148.93 3,765 63.48 -20.24
Functions 112.06 222.6 2,008 34.48 -10.2

Top API waits (after)

API request Max wait (ms)
functions.delete 427.97
account.prefs.update 407.58
account.name.update 399.35
functions.create 352.14
functions.variables.update 352.05

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.

Keep released SDK parameter order on messaging and OAuth2 updates

1 participant