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

Idempotency - not working? #875

Open
ortschun opened this issue Nov 24, 2023 Discussed in #874 · 2 comments
Open

Idempotency - not working? #875

ortschun opened this issue Nov 24, 2023 Discussed in #874 · 2 comments

Comments

@ortschun
Copy link

Discussed in https://github.com/orgs/inngest/discussions/874

Originally posted by ortschun November 24, 2023
Hey folks, I'm new to inngest and loving the product so far. Currently, I am having difficulties with getting the idempotency key to work. I might be missing something regarding the functionality.

The behavior I am expecting is, when there's a send event, if the id field is set, it will only run a single send call for a given particular id and drop the other send events.

I'm on nextjs, and have this function below using the same const idempotencyKey, testing on local development stack, with local inngest running, called literally one after the other.

await inngest.send({
    id: idempotencyKey,
    name: CREATE_GOOGLE_CALENDAR_INVITE_EVENT_NAME,
    data: data,
  });
  await inngest.send({
    id: idempotencyKey,
    name: CREATE_GOOGLE_CALENDAR_INVITE_EVENT_NAME,
    data: data,
  });
  await inngest.send({
    id: idempotencyKey,
    name: CREATE_GOOGLE_CALENDAR_INVITE_EVENT_NAME,
    data: data,
  });

I expect this to trigger only once but I see all 3 events succeeding, creating 3 calendar invites. Would love to understand if I'm not using idempotency in the intended way, or running into an inngest issue!

@ortschun
Copy link
Author

ortschun commented Dec 4, 2023

Ping on here to check if anyone has run into this?

@halfbakedsneed
Copy link

halfbakedsneed commented Dec 8, 2023

Yep, we're observing the exact same behaviour, but only when using the local dev server. In cloud environments, id functions as you'd expect.

Local CLI version: 0.23.0 (also happening on 0.22.x)

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

2 participants