Skip to content

Gotify and Ntfy settings fail to persist serverThreshold preference + Teams notification unhandled rejection #5175

Closed

Description

@abhi128nandan

To Reproduce

  1. Navigate to the Settings > Notifications page in the dashboard.
  2. Select Gotify (or Ntfy) as the notification provider.
  3. Toggle the Server Threshold switch to ON (enabled).
  4. Click Save to create or update the notification setting.
  5. Refresh the page or click back into the Gotify/Ntfy notification setting.
  6. Observe that the Server Threshold switch has reset to OFF (disabled) and the preference was not saved to the database.

For the Teams error boundary issue:

  1. Configure a Teams notification with an invalid webhook URL (or simulate a network failure).
  2. Trigger a server threshold alert condition.
  3. Observe that the sendTeamsNotification function throws an error, but because it sits outside the try/catch loop in packages/server/src/utils/notifications/server-threshold.ts, the error escapes as an unhandled rejection.
  4. Observe that any remaining notification providers configured for that threshold alert are never processed.

Current vs. Expected behavior

Gotify/Ntfy Server Threshold Persistence:

  • Current Behavior: The serverThreshold UI preference for Gotify and Ntfy is silently stripped during backend validation (apiCreateGotify/apiCreateNtfy schemas) and is omitted from the database inserts/updates in the service layer.
  • Expected Behavior: The preference should successfully persist in the database and hydrate correctly in the UI upon refresh, matching the behavior of the other 9 notification providers.

Teams Error Boundary:

  • Current Behavior: If the sendTeamsNotification dispatcher fails in server-threshold.ts, it causes an unhandled rejection that breaks out of the notification processing loop entirely.
  • Expected Behavior: The Teams notification dispatcher should be wrapped inside the loop's try/catch block (like all other dispatchers in the codebase) so that a failure gracefully logs the error and allows the loop to continue sending notifications to other configured providers.

Provide environment information

- **Dokploy Version:** Canary
- **Browser:** N/A (Backend & UI mismatch)

Which area(s) are affected? (Select all that apply)

Local Development

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

Proposed Solution

  • Add serverThreshold: true to the Zod validation schemas and service layers for Gotify and Ntfy, matching the other providers. Add the field to the UI form.reset and mutateAsync payloads.
  • Move the if (teams) block inside the try/catch in server-threshold.ts.

Will you send a PR to fix it?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions