bug: Duplicate processing of pull_request synchronize webhooks
@SanjayNivasG is already working on this.
Since Sep 17, 2026.
Assessment
This issue has not been assessed yet.
Description
Description
Summary
The GitHub pull_request synchronize webhook appears to be processed twice.
The webhook handler directly calls handlePullRequestSynchronize() for pull_request synchronize events and then subsequently queues the same webhook payload using addWebhookJob().
This can cause the same pull-request synchronization event to be processed both synchronously and asynchronously.
Expected behavior
A webhook delivery should be processed exactly once through a single processing path.
The request handler should either:
- process the event synchronously, or
- enqueue it for asynchronous processing.
It should not execute the processing logic and then enqueue the same event again.
Actual behavior
For a pull_request event with:
action = synchronize
the handler executes:
await handlePullRequestSynchronize(parsed.payload);
and later executes:
await addWebhookJob(
{
payload: parsed.payload,
deliveryId,
event,
},
{ jobId: webhookJobId(deliveryId) },
);
Therefore, the same delivery enters both processing paths.
handlePullRequestSynchronize() already performs database operations, retrieves changed files from GitHub, scans dependency manifests, and creates vulnerability findings before the queue job is added.
Steps to reproduce
- Configure SecureFlow with a valid GitHub webhook.
- Create a Pull Request in a repository monitored by SecureFlow.
- Push another commit to the Pull Request to trigger a
pull_request.synchronizewebhook. - Inspect the SecureFlow application logs and database activity.
- Observe that
handlePullRequestSynchronize()executes before the webhook job is queued. - The queued job can subsequently process the same webhook delivery again.
Screenshots / Logs
[PR_SYNC] New code pushed to PR #...
[SBOM] Checking ... files for manifests...
[SBOM] Found ... vulnerabilities...
... webhook job queued for the same delivery ID ...
Environment
- SecureFlow version/commit:
- Deployment method:
- Node version:
- OS:
Additional context
The webhook route currently performs:
verify webhook
↓
handlePullRequestSynchronize()
↓
addWebhookJob()
↓
worker processing
This creates two possible processing paths for the same delivery.
The duplicate processing can result in unnecessary GitHub API calls, repeated dependency scanning, duplicate database work, and potentially duplicate findings or other side effects depending on the worker implementation.
A cleaner design would be to make the webhook endpoint responsible only for validation and queueing, with the worker being the single owner of webhook processing.
Alternatively, if synchronous processing is intentional, the event should not subsequently be queued for processing again.
- Dominant language
- TypeScript
- Stars
- 10
- Forks
- 79
- Avg merge
- 11h 9m
- Merged PRs (30d)
- 252
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GauravKarakoti/SecureFlow
-
Help command for cli OpenOSCI'26
GauravKarakoti/SecureFlow#1017 · 2 comments · 1 assignee ·
-
OSCI'26
GauravKarakoti/SecureFlow#998 · 1 assignee ·
-
OSCI'26
GauravKarakoti/SecureFlow#994 · 2 comments · 1 assignee ·
-
OSCI'26
GauravKarakoti/SecureFlow#987 · 1 comment · 1 assignee ·
-
bug OSCI'26
GauravKarakoti/SecureFlow#884 · 1 comment · 1 assignee ·
All issues in GauravKarakoti/SecureFlow
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·