🐛 Bug Report: Function and webhook events reject `tablesdb.*.tables.*.rows.*.upsert` ("Event is not valid") · Issue #14653 · appwrite/appwrite · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐛 Bug Report: Function and webhook events reject tablesdb.*.tables.*.rows.*.upsert ("Event is not valid") #14653
The function is created. upsert is a documented row event
(app/config/events.php,
platform events docs), and Appwrite emits it: a function subscribed to tablesdb.<db>.tables.<table>.rows.* receives tablesdb.<db>.tables.<table>.rows.<id>.upsert for
single and bulk upserts.
👎 Actual Behavior
400 general_argument_invalid: "Invalid events param: Value must a valid array no longer than 100
items and Event is not valid."
Cause: for a pattern with three resource levels (type.id.subType.id.subSubType.id.action), Event::isValid()
takes the action from $parts[6] but looks it up one level too high:
if ($subType) {
if ($action && !\array_key_exists($action, $events[$type][$subType])) { // $events['tablesdb']['tables']returnfalse;
}
create, update and delete pass only because the table level has actions with the same names. upsert exists only under rows, so every row upsert subscription is refused. The same
validator is used for webhooks (Webhooks/Http/Webhooks/Create.php, Update.php).
Side effect: one rejected entry fails the whole function update, so appwrite push functions
also does not deploy the code, and the previous deployment keeps running.
Suggested fix: when $hasSubSubResource, check the action against $events[$type][$subType][$subSubType] (and the attribute part likewise).
🎲 Appwrite version
Different version (specify in environment)
💻 Operating system
Linux
🧱 Your Environment
Appwrite 2.5.0, self-hosted with Docker Compose (Postgres). Reproduced on a fresh installation
without modifications and on a production cluster.
👀 Have you spent some time to check if this issue has been raised before?
I checked and didn't find similar issue
Related: #10317 (added upsert to the events config)
Hi, since this one was released, I'd like to pick it up. I have a fix with a unit regression test: for 7-part patterns, Event::isValid() now checks the action against the sub-sub resource level (rows / documents) and not the parent (tables / collections), so ...rows.*.upsert is accepted and unknown row actions are still rejected. I've opened the fix in #14742.
Activity
drakeo338 commentedon Oct 19, 2026
Hi, I'd like to be assigned to this one. I've reproduced it and have a fix with a test ready to open as a PR shortly.
drakeo338 commentedon Oct 21, 2026
Releasing this one: I won't be opening the PR after all, so anyone is welcome to pick it up.
callmegautam commentedon Oct 21, 2026
Hi, since this one was released, I'd like to pick it up. I have a fix with a unit regression test: for 7-part patterns,
Event::isValid()now checks the action against the sub-sub resource level (rows/documents) and not the parent (tables/collections), so...rows.*.upsertis accepted and unknown row actions are still rejected. I've opened the fix in #14742.