[PR #2295] [MERGED] fix: local job retry loop for webhook calls #2190

Closed
opened 2026-02-26 20:32:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/2295
Author: @gps949
Created: 12/7/2025
Status: Merged
Merged: 12/15/2025
Merged by: @dguyen

Base: mainHead: patch-1


📝 Commits (3)

  • 70869b9 fix(local-jobs): mark retries when requeuing tasks
  • 1473cf6 Merge branch 'main' into patch-1
  • aa50499 Merge branch 'main' into patch-1

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 packages/lib/jobs/client/local.ts (+1 -0)

📄 Description

Description

This PR prevents the local job provider from endlessly requeuing failed webhook jobs. We now flag the initial submission as a non-retry and mark subsequent submissions as
retries so the existing retry counter and maxRetries guard start working again.

Fixes the data/log explosion caused by WebhookCall insertions on repeated webhook failures when running with the local job provider.

Changes Made

  • Pass isRetry: false when the job is first enqueued so the handler receives an explicit flag.
  • Pass isRetry: true when a failed job is requeued, allowing the retried counter to increment and the maxRetries protection to fire.

Testing Performed

  • Not run (logic-only fix; environments with the local provider will exercise the new behavior automatically).

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have updated the documentation to reflect these changes, if applicable.
  • I have followed the project's coding style guidelines.
  • I have addressed the code review feedback from the previous submission, if applicable.

Additional Notes

Once this lands, consider adding a background cleanup job (or data retention policy) for WebhookCall to shrink inflated tables created before the fix.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/2295 **Author:** [@gps949](https://github.com/gps949) **Created:** 12/7/2025 **Status:** ✅ Merged **Merged:** 12/15/2025 **Merged by:** [@dguyen](https://github.com/dguyen) **Base:** `main` ← **Head:** `patch-1` --- ### 📝 Commits (3) - [`70869b9`](https://github.com/documenso/documenso/commit/70869b9b2d44501e43dc3246950c87ad39cebb63) fix(local-jobs): mark retries when requeuing tasks - [`1473cf6`](https://github.com/documenso/documenso/commit/1473cf66766cf0bccc544bc093f529b20eda3006) Merge branch 'main' into patch-1 - [`aa50499`](https://github.com/documenso/documenso/commit/aa5049993c92fc1c8e94cc0324a7baa58d4c9dff) Merge branch 'main' into patch-1 ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/lib/jobs/client/local.ts` (+1 -0) </details> ### 📄 Description ## Description This PR prevents the local job provider from endlessly requeuing failed webhook jobs. We now flag the initial submission as a non-retry and mark subsequent submissions as retries so the existing retry counter and maxRetries guard start working again. ## Related Issue Fixes the data/log explosion caused by WebhookCall insertions on repeated webhook failures when running with the local job provider. ## Changes Made - Pass isRetry: false when the job is first enqueued so the handler receives an explicit flag. - Pass isRetry: true when a failed job is requeued, allowing the retried counter to increment and the maxRetries protection to fire. ## Testing Performed - Not run (logic-only fix; environments with the local provider will exercise the new behavior automatically). ## Checklist - [ ] I have tested these changes locally and they work as expected. - [ ] I have added/updated tests that prove the effectiveness of these changes. - [x] I have updated the documentation to reflect these changes, if applicable. - [x] I have followed the project's coding style guidelines. - [ ] I have addressed the code review feedback from the previous submission, if applicable. ## Additional Notes Once this lands, consider adding a background cleanup job (or data retention policy) for WebhookCall to shrink inflated tables created before the fix. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 20:32:49 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#2190
No description provided.