Skip to content

feat(messaging): include messageId in the Appwrite push payload - #13981

Merged
ArnabChatterjee20k merged 2 commits into
mainfrom
add-message-id-to-push-payload
Sep 29, 2026
Merged

ArnabChatterjee20k merged 2 commits into
mainfrom
add-message-id-to-push-payload

Conversation

@ArnabChatterjee20k

Copy link
Copy Markdown
Member

The MQTT payload delivered to clients carried no campaign id, so a client could not dedup a message received over another channel (e.g. APNs in the background). Add messageId to buildPayload()'s envelope; it was already the ledger's dedup key.

What does this PR do?

(Provide a description of what this PR does and why it's needed.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)

Related PRs and Issues

  • (Related PR or issue)

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?

The MQTT payload delivered to clients carried no campaign id, so a client
could not dedup a message received over another channel (e.g. APNs in the
background). Add messageId to buildPayload()'s envelope; it was already the
ledger's dedup key.
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds message ID to push notification payload.

The PR appears safe to merge; the live subscriber test now checks the campaign ID and no blocking issue remains.

Summary

The PR adds the campaign message ID to the Appwrite push payload and verifies that a live MQTT subscriber receives the same ID returned by the messaging API.

  • The new subscriber assertion addresses the prior review concern about testing live delivery.
  • No new actionable issue was established.

Reviews (2) · Last reviewed commit: "test(mqtt): assert the live subscriber r..."

The unit test only checked the payload recorded by a fake broker. Assert
messageId in the payload delivered to the live MQTT subscriber too, so a
regression dropping the campaign id from the wire is caught.
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → add-message-id-to-push-payload (after).

Metric Before After Change
🚀 Requests/sec 199.81 203.37 ⚪ +1.8%
⏱️ Latency P50 84.81 ms 85.4 ms ⚪ +0.7%
⏱️ Latency P95 211.17 ms 197.45 ms 🟢 -6.5%
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 85.4 197.45 12,597 203.37 -13.72
Account 164.07 320.38 663 11.03 +2.39
TablesDB 82.13 154.57 6,851 112.43 -8.11
Storage 80.58 177.79 3,315 56.49 -0.6
Functions 118.34 237.59 1,768 30.74 -13.64

Top API waits (after)

API request Max wait (ms)
account.prefs.update 528.75
account.name.update 380.91
functions.variables.update 370.54
functions.delete 351.03
functions.create 346.74

@ArnabChatterjee20k
ArnabChatterjee20k merged commit 8bdd89f into main Sep 29, 2026
53 checks passed
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.

2 participants