Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions python/dify_plugin/interfaces/trigger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ def delete_subscription(
If this method raises an exception, Dify will still remove the subscription
but display a warning message to the user.

If the subscription no longer exists on the external service (e.g., already
deleted or expired), this method should return `success=True`. This ensures
idempotent behavior, as the desired state (the subscription being absent)
is already met.

Examples:
Successful unsubscription:
>>> subscription = Subscription(
Expand Down
6 changes: 2 additions & 4 deletions python/examples/github_trigger/provider/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,8 @@ def _delete_subscription(
)

if response.status_code == 404:
raise UnsubscribeError(
message=f"Webhook {external_id} not found in repository {repository}",
error_code="WEBHOOK_NOT_FOUND",
external_response=response.json(),
return UnsubscribeResult(
success=True, message=f"Webhook {external_id} not found in repository {repository}"
)

raise UnsubscribeError(
Expand Down