Skip to content

fix(webhooks): include subtasks in delivery scan - #1931

Open
pengpengyi92 wants to merge 1 commit into
TabbyML:mainfrom
pengpengyi92:fix/webhook-subtask-parent-1663
Open

fix(webhooks): include subtasks in delivery scan#1931
pengpengyi92 wants to merge 1 commit into
TabbyML:mainfrom
pengpengyi92:fix/webhook-subtask-parent-1663

Conversation

@pengpengyi92

Copy link
Copy Markdown

Summary

  • keep the existing root-task query used by task-list consumers
  • add an all-task query for webhook delivery
  • include updated subtasks in the Cloudflare webhook scan so their real
    parentId reaches the existing payload serializer
  • add a regression that pins root-only and all-task query semantics separately

Fixes #1663

Root cause

The webhook path reused tasks$, which intentionally filters
parentId = null. Child rows were therefore excluded before payload
serialization; changing the serializer alone could not repair the behavior.

Test plan

  • LiveKit package test suite (142 passed)
  • TypeScript checks for packages/livekit and packages/livekit-cf
  • Biome check for all modified files
  • git diff --check

Boundary

No database schema or webhook payload contract changes. The patch only changes
which recently updated task rows are eligible for webhook delivery. The local
pre-push script also requires Bun, which is unavailable on this workstation;
the focused suites above passed and the upstream CI remains the full-repository
gate.

@zhanba

zhanba commented Sep 3, 2026

Copy link
Copy Markdown
Member

Thanks for the contribution! Could you share the real-world use case behind this change?

@pengpengyi92

Copy link
Copy Markdown
Author

Thanks for checking. I do not operate the reporter's Ragdoll deployment, so I
cannot claim an independently captured production payload. I took the concrete
use case from #1663 and verified the corresponding source path:

  1. v1.TaskInited persists a child task's parentId in tables.tasks.
  2. LiveStoreClientDO.onTasksUpdate() used tasks$, whose explicit
    parentId = null predicate returns only root tasks.
  3. WebhookDelivery spreads the task row into the payload, but child rows
    never reached that serializer. A downstream consumer such as the Ragdoll
    integration described in Bug: parent id is not included in livekit-cf webhook #1663 therefore receives root-task updates only
    and cannot reconstruct the child-to-parent relationship.

The patch does not synthesize or rewrite parentId; it lets an updated child
row reach the existing task.updated payload with its stored parent ID. The
trade-off is that webhook volume now includes updated subtasks as well as root
tasks.

If the intended webhook contract is root tasks only, this PR should be closed.
If integrations are expected to consume subtask lifecycle events, I can replace
the current query-contract regression with a focused delivery-path test before
merge. A sanitized payload or expected Ragdoll contract from the reporter would
also let me validate that boundary more directly.

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.

Bug: parent id is not included in livekit-cf webhook

2 participants