You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configure an application with preview deployment limit set to 3
Open 3 PRs that trigger preview deployments
Push a commit to one of the open PRs
The preview does not rebuild, the webhook delivery shows 200 in Github, but no build is queued
Deleting an old preview deployment to get back under the limit restores rebuild behaviour
Current vs. Expected behavior
Expected
Pushing a commit to a PR with an existing preview deployment should rebuild that preview. The preview limit should only prevent new previews from being created.
Actual
The limit check in the webhook handler runs early & silently drops the update event, leaving the preview build stale
Provide environment information
Operating System: Ubuntu 24.04 LTS
Arch: amd64
Dokploy version: 0.28.7
What applications/services are you trying to deploy?
- Multiple React apps with GitHub App integration and label-based preview deployments
Which area(s) are affected? (Select all that apply)
Application
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
Secondary issues in the same check when researching the root cause
Preview limit defaults to 0 instead of the db schema default of 3
Limit comparison allows one extra preview beyond the limit
I've created a PR in my fork to show the fix, but I have yet to test this on my server so refrained from submitting upstream
Your fork's fix approach (moving the limit check to only apply when creating new previews) is the right solution. Feel free to open the upstream PR—the fix looks well-scoped!
constpreviewLimit=app?.previewLimit||0;if(app?.previewDeployments?.length>previewLimit){continue;// ← drops the event entirely}constpreviewDeploymentResult=awaitfindPreviewDeploymentByApplicationId(app.applicationId,prId);
The limit check runs before the lookup that would tell us whether this PR already has a preview, so a push to an existing preview is skipped with no build queued and no error — the webhook still returns 200 to GitHub, which is why delivery looks healthy. Moving the check so it only guards the createPreviewDeployment path would fix it.
One extra detail worth noting for the fix: the comparison is > rather than >=, so with previewLimit = 3 the fourth preview is still created and only the fifth is blocked. Whoever changes this should decide whether the limit is meant to be inclusive; fixing the ordering without the boundary would keep an off-by-one.
Activity
dosubot commentedon Mar 26, 2026
Hi @stevenkissack! I'm Dosu and I’m helping the dokploy team.
Your analysis is spot on! I found the exact code causing this issue.
Root Cause: The limit check at lines 474-477 of
github.tsruns before checking if a preview already exists:The existence check at lines 478-494 that determines update vs. create never gets reached when at the limit.
Your secondary findings are also confirmed:
|| 0fallback should be?? 3to respect the DB schema default>should be>=to enforce the exact limitYour fork's fix approach (moving the limit check to only apply when creating new previews) is the right solution. Feel free to open the upstream PR—the fix looks well-scoped!
To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
fix(github): preview limit check should not block updates to existing…
Siumauricio commentedon Aug 4, 2026
Confirmed on v0.29.13 by reading the webhook handler — your description of the mechanism is accurate.
pages/api/deploy/github.ts:The limit check runs before the lookup that would tell us whether this PR already has a preview, so a push to an existing preview is skipped with no build queued and no error — the webhook still returns 200 to GitHub, which is why delivery looks healthy. Moving the check so it only guards the
createPreviewDeploymentpath would fix it.One extra detail worth noting for the fix: the comparison is
>rather than>=, so withpreviewLimit = 3the fourth preview is still created and only the fifth is blocked. Whoever changes this should decide whether the limit is meant to be inclusive; fixing the ordering without the boundary would keep an off-by-one.Confirmed; keeping open.
fix(github-webhook): apply preview limit only to new previews
chore(release): 0.42.0 [skip ci]