[bug]: issue webhook never fires on state/assignee/label/module changes (model_activity key mismatch)

オープン
#10,343 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Yuvraj7Yadav がすでに取り組んでいます。

2026年11月18日 から。

  • #10346 @Yuvraj7Yadav による — オープン
  • #10418 @avesh-pathak による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
django, python

調査の方向性

Start with model_activity() in plane/bgtasks/webhook_task.py and trace how PATCH data from plane/app/views/issue/base.py is compared with the serialized issue. Check the open linked pull request (#10346) for work already underway. Done means issue updates for state, assignees, labels, and modules enqueue webhook deliveries while preserving the API-side field names.

索引モデルが issue の本文から書いたものです。

説明

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

The issue webhook never fires for a state change (nor for assignee, label or module changes) on self-hosted Community Edition.

Reproduced on a self-hosted instance (v1.4.3, PLANE_COMMUNITY, MinIO storage, Docker Compose). The webhook is registered with issue = true, is active, and workitem.created events do arrive. Moving a work item from Todo to In Progress produces no delivery at all — webhook_logs stays empty and the endpoint is never called.

The cause is in plane/bgtasks/webhook_task.py, model_activity() (line 479):

for key in requested_data:
    # Check if key is present in current instance or not
    if key in current_instance:            # ← line 503
        current_value = current_instance.get(key, None)
        requested_value = requested_data.get(key, None)
        if current_value != requested_value:
            webhook_activity.delay(... )

requested_data is request.data (the PATCH body, see plane/app/views/issue/base.py:476 and :701). The API accepts the relation name for related objects — state, assignees, labels, modules — while current_instance is the serialized issue, which carries the foreign-key/relation field names state_id, assignee_ids, label_ids, module_ids.

The key therefore never matches, webhook_activity is never queued, and no delivery happens.

Checked against the fields an issue PATCH is commonly sent with:

request.data key present in current_instance? webhook on update
state no (it is state_id) never
assignees no (it is assignee_ids) never
labels no (it is label_ids) never
modules no (it is module_ids) never
name yes works
priority yes works
start_date / target_date yes works

So a webhook subscribed to work item updates only ever receives title/priority/date changes. Any integration that reacts to status, assignment or labels is silently non-functional — which is exactly what these webhooks exist for.

Note: verb="created" is unaffected, because the current_instance is None branch returns before the loop. That is why "webhooks work" can look true while the update path is dead.

Steps to reproduce

  1. Self-hosted Plane with an active webhook on issue events pointing at any HTTP endpoint you can inspect.
  2. Create a work item (this fires a created event — confirms the webhook is wired correctly).
  3. Change its state (e.g. Todo → In Progress).
  4. Observe: no request arrives at the endpoint, and webhook_logs gets no row for that change.

Reproduce the core in plain Python, no Plane needed:

requested_data = {"state": "8d7f779a-b0d2-4e9d-8876-e5f9342b4260"}   # PATCH body
current_instance = {"id": "...", "name": "...", "state_id": "..."}    # serialized issue

matches = [k for k in requested_data if k in current_instance]
print(matches)   # [] → webhook_activity is never called

Suggested fix

Map the request-side relation names onto the instance-side field names before the lookup:

_request_key_aliases = {
    "state": "state_id",
    "assignees": "assignee_ids",
    "labels": "label_ids",
    "modules": "module_ids",
}

for key in requested_data:
    instance_key = _request_key_aliases.get(key, key)
    if instance_key in current_instance:
        current_value = current_instance.get(instance_key, None)
        requested_value = requested_data.get(key, None)
        if current_value != requested_value:
            webhook_activity.delay(
                event=model_name,
                verb="updated",
                field=key,          # keep the API-side name in the payload
                old_value=current_value,
                new_value=requested_value,
                ...
            )

This fixes all four relations with one change and leaves the webhook payload's field value as the API name (unchanged for existing consumers). Note that state itself is an interesting case: the current value must be compared as an id (state_id), which the alias does naturally.

I have this patch running on a self-hosted v1.4.3 instance (local overlay image); state-change deliveries start arriving as soon as it is in place. Happy to open a PR with the patch and a regression test if that is useful — I did not want to open one before confirming the behaviour is not intentional.

Environment

Production

Browser

Other — reproduced with the REST API and with the web UI, and verified against webhook_logs in the database.

Variant

Self-hosted (Community Edition, Docker Compose)

Version

v1.4.3

主要言語
TypeScript
スター
63k
フォーク
6.5k
平均マージ
2日 16時間
マージ済み PR(30日)
70

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

makeplane/plane のほかの issue

makeplane/plane の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。