Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Wunhyeon opened this issue Sep 19, 2024 · 0 comments

Comments

@Wunhyeon
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant