Skip to content

Incorrect Conflict Target in storeWebhookEvent: plans.id vs webhookEvents.id #14

@Wunhyeon

Description

@Wunhyeon

In the storeWebhookEvent function in src/app/actions.ts, the following code is used:

const returnedValue = await db
    .insert(webhookEvents)
    .values({
      id,
      eventName,
      processed: false,
      body,
    })
    .onConflictDoNothing({ target: plans.id })
    .returning();

Currently, the insert is being made to webhookEvents, but the target of onConflictDoNothing is set to plans.id. Since there is no foreign key relationship between webhookEvents and plans, using plans.id as the target seems incorrect. Shouldn't it be webhookEvents.id instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions