Skip to content

Webhook Notification Configuration: Double Configuration System Causes Confusion #136

@njayasathya

Description

@njayasathya

Title

Webhook Notification Configuration: Double Configuration System Causes Confusion

Description

There are two competing webhook notification configuration systems in Nutify that create confusion:

  1. ups_opt_webhook table - Has notify_onbatt, notify_online, notify_lowbatt, etc. fields
  2. ups_opt_notification table - Has webhook_enabled and id_webhook fields

The problem: Only ups_opt_notification is actually used, but users see the notify_* fields in the UI/database and expect them to work.

Root Cause

  • send_event_notification() in webhook.py calls get_enabled_configs_for_event()
  • get_enabled_configs_for_event() in db.py reads ONLY from ups_opt_notification table
  • The notify_* fields in ups_opt_webhook are never checked or used

Expected Behavior

Users should be able to enable webhooks by setting notify_* flags in ups_opt_webhook, OR the UI should only show the actual configuration in ups_opt_notification.

Current Behavior

Enabling notify_onbatt, notify_online, etc. in ups_opt_webhook doesn't trigger webhooks. Users must manually enable webhooks in the disconnected ups_opt_notification table.

Files Affected

  • nutify/core/extranotifs/webhook/webhook.py - send_event_notification()
  • nutify/core/extranotifs/webhook/db.py - get_enabled_configs_for_event()
  • nutify/core/db/orm/orm_ups_opt_webhook.py - WebhookConfig model (legacy fields)

Solution Options

  1. Remove legacy fields - Delete notify_* columns from ups_opt_webhook ORM model
  2. Unify the systems - Make ups_opt_webhook.notify_* the source of truth instead of ups_opt_notification
  3. Document the issue - Clarify that only ups_opt_notification controls routing

Workaround

Always configure webhooks via ups_opt_notification table with:

  • webhook_enabled = 1
  • id_webhook = <webhook_id>
  • target_id = NULL (for global) or specific target ID

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions