René's URL Explorer Experiment


Title: Idempotency keys only dedupe task.trigger() calls — the docs list "avoiding double-charging customers" as a use case, but a payment call made directly inside run() gets no protection · Issue #4627 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: Idempotency keys only dedupe task.trigger() calls — the docs list "avoiding double-charging customers" as a use case, but a payment call made directly inside run() gets no protection · Issue #4627 · triggerdotdev/trigger.dev

X Title: Idempotency keys only dedupe task.trigger() calls — the docs list "avoiding double-charging customers" as a use case, but a payment call made directly inside run() gets no protection · Issue #4627 · triggerdotdev/trigger.dev

Description: Hi — really like how deliberately this project has thought about retries (per-task config, exponential backoff, staging/prod on by default with dev opt-out documented plainly). This is about a gap in the idempotency system itself, from r...

Open Graph Description: Hi — really like how deliberately this project has thought about retries (per-task config, exponential backoff, staging/prod on by default with dev opt-out documented plainly). This is about a gap ...

X Description: Hi — really like how deliberately this project has thought about retries (per-task config, exponential backoff, staging/prod on by default with dev opt-out documented plainly). This is about a gap ...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/issues/4627

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Idempotency keys only dedupe task.trigger() calls — the docs list \"avoiding double-charging customers\" as a use case, but a payment call made directly inside run() gets no protection","articleBody":"Hi — really like how deliberately this project has thought about retries (per-task config, exponential backoff, staging/prod on by default with dev opt-out documented plainly). This is about a gap in the idempotency system itself, from reading `docs/idempotency.mdx` and `packages/trigger-sdk/src/v3/idempotencyKeys.ts` against `69f396f`. No runtime testing — happy to be corrected if this is handled somewhere I didn't find.\n\n### The shape\n\n`docs/idempotency.mdx` lists this as a use case (line 35):\n\n> **Avoiding double-charging customers** - Prevent duplicate payment processing during retries\n\nBut every code example in the same doc — including the one directly under that bullet — only shows idempotency protecting `childTask.trigger()`:\n\n```ts\nconst idempotencyKey = await idempotencyKeys.create(\"my-task-key\");\nawait childTask.trigger({ foo: \"bar\" }, { idempotencyKey });\n```\n\nAnd `idempotencyKeys.ts` confirms this is the entire surface:\n\n```ts\nexport const idempotencyKeys = {\n  create: createIdempotencyKey,\n  reset: resetIdempotencyKey,\n};\n```\n\nThere is no primitive that makes an arbitrary side effect idempotent — only `task.trigger()`/`triggerAndWait()` calls consume an idempotency key. A payment call made directly inside `run()`, rather than moved into a child task, gets no protection from this system at all.\n\n### Why that's a real gap, not just a docs nit\n\nRetries are on by default outside dev (`docs/errors-retrying.mdx`: *\"By default when you create your project using the CLI init command we disabled retrying in the DEV environment\"* — implying prod/staging retry by default), and the docs' own canonical retry example is:\n\n```ts\nexport const myTask = task({\n  id: \"my-task\",\n  retry: { maxAttempts: 4 },\n  run: async (payload) => {\n    const idempotencyKey = await idempotencyKeys.create(\"my-task-key\");\n    await childTask.trigger({ foo: \"bar\" }, { idempotencyKey });\n    throw new Error(\"Something went wrong\");   // triggers a retry of THIS task\n  },\n});\n```\n\nA developer who read \"avoiding double-charging customers\" as a supported use case, and naturally reached for the pattern shown immediately below it, would write:\n\n```ts\nrun: async (payload) => {\n  await stripe.refunds.create({ payment_intent: payload.piId, amount: payload.amount });\n  await sendConfirmationEmail(payload);   // throws for an unrelated reason\n}\n```\n\nThe email step failing retries the whole task (per the configured `maxAttempts`), and the refund call — having no idempotency key of its own — runs again on the retry. The task-level idempotency key never touches it, because nothing in this task calls `trigger()`.\n\n### Suggested fix\n\nTwo independent options, not mutually exclusive:\n\n1. Narrow the doc claim precisely: state that idempotency keys dedupe **task triggers**, not arbitrary code inside `run()`, and that the correct pattern for \"avoid double-charging\" is to always wrap the payment call in a child task triggered with a key — never call a payment API directly inside a retryable `run()`.\n2. Or close the actual gap: a general-purpose helper — something like `idempotencyKeys.run(key, fn)` — that persists the result of an arbitrary async operation keyed the same way `trigger()` already is, so a direct API call inside `run()` can opt into the same protection without being restructured into a child task.\n\nEither would stop the doc's own payments use case from silently not applying to the code shown right next to it.\n","author":{"url":"https://github.com/aurumflux20","@type":"Person","name":"aurumflux20"},"datePublished":"2026-08-15T00:25:13Z","url":"https://github.com/triggerdotdev/trigger.dev/issues/4627"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8f4c663d-eda5-4bf2-12af-29f0f5abfe0f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8674:141D8D:733304C:996A4B3:6AFADAC2
html-safe-nonce2144ebfb2cd0be29e158580d8fa6d9037319493b88603622cbf2814e2979da7d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Njc0OjE0MUQ4RDo3MzMzMDRDOjk5NkE0QjM6NkFGQURBQzIiLCJ2aXNpdG9yX2lkIjoiNjk1NTM4NDIzOTgyMjY1ODI0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac3c38b566bdf9efc87f27140f70d0df53ee9f272016073d455aa633f3bdffbd47
hovercard-subject-tagissue:5156687015
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/triggerdotdev/trigger.dev/4627/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3403f17b9a87dff4057e40c95abd8aa95472b29081af19735e3396ee32389bed/triggerdotdev/trigger.dev/issues/4627
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3403f17b9a87dff4057e40c95abd8aa95472b29081af19735e3396ee32389bed/triggerdotdev/trigger.dev/issues/4627
og:image:altHi — really like how deliberately this project has thought about retries (per-task config, exponential backoff, staging/prod on by default with dev opt-out documented plainly). This is about a gap ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameaurumflux20
hostnamegithub.com
expected-hostnamegithub.com
None9d9bd51a568909a83d1abb9d6f74d68f0c87ca85fe3a56d3f5d70d8b89add9f2
turbo-cache-controlno-preview
go-importgithub.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id572570113
octolytics-dimension-repository_nwotriggerdotdev/trigger.dev
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id572570113
octolytics-dimension-repository_network_root_nwotriggerdotdev/trigger.dev
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4a7ae932999cc6d511008dbf980ff9efad2a31f7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/issues/4627#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2F4627
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2F4627
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/issues/4627
Reloadhttps://github.com/triggerdotdev/trigger.dev/issues/4627
Reloadhttps://github.com/triggerdotdev/trigger.dev/issues/4627
triggerdotdevhttps://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Codehttps://github.com/triggerdotdev/trigger.dev
Issues203 (203)https://github.com/triggerdotdev/trigger.dev/issues
Pull requests65 (65)https://github.com/triggerdotdev/trigger.dev/pulls
Discussionshttps://github.com/triggerdotdev/trigger.dev/discussions
Actionshttps://github.com/triggerdotdev/trigger.dev/actions
Projectshttps://github.com/triggerdotdev/trigger.dev/projects
Security and quality39 (39)https://github.com/triggerdotdev/trigger.dev/security
Insightshttps://github.com/triggerdotdev/trigger.dev/pulse
https://github.com/triggerdotdev/trigger.dev
New issuehttps://github.com/login?return_to=https://github.com/triggerdotdev/trigger.dev/issues/4627
New issuehttps://github.com/login?return_to=https://github.com/triggerdotdev/trigger.dev/issues/4627
Idempotency keys only dedupe task.trigger() calls — the docs list "avoiding double-charging customers" as a use case, but a payment call made directly inside run() gets no protectionhttps://github.com/triggerdotdev/trigger.dev/issues/4627#top
https://github.com/aurumflux20
aurumflux20https://github.com/aurumflux20
on Aug 15, 2026https://github.com/triggerdotdev/trigger.dev/issues/4627#issue-5156687015
https://github.com/bharathkumar39293
bharathkumar39293https://github.com/bharathkumar39293
on Aug 17, 2026https://github.com/triggerdotdev/trigger.dev/issues/4627#issuecomment-5316083808
#4650https://github.com/triggerdotdev/trigger.dev/pull/4650
https://github.com/leadingproblemsolver
leadingproblemsolverhttps://github.com/leadingproblemsolver
on Aug 25, 2026https://github.com/triggerdotdev/trigger.dev/issues/4627#issuecomment-5412374461
ChatGPT Codex Connectorhttps://www.chatgpt.com
https://github.com/aurumflux20
aurumflux20https://github.com/aurumflux20
on Aug 28, 2026https://github.com/triggerdotdev/trigger.dev/issues/4627#issuecomment-5448470925
@leadingproblemsolverhttps://github.com/leadingproblemsolver
https://github.com/aurumflux20/sealhttps://github.com/aurumflux20/seal
https://github.com/leadingproblemsolver
leadingproblemsolverhttps://github.com/leadingproblemsolver
on Aug 29, 2026https://github.com/triggerdotdev/trigger.dev/issues/4627#issuecomment-5465064240
ChatGPT Codex Connectorhttps://www.chatgpt.com
https://github.com/aurumflux20
aurumflux20https://github.com/aurumflux20
on Aug 31, 2026https://github.com/triggerdotdev/trigger.dev/issues/4627#issuecomment-5472474249
#3188https://github.com/triggerdotdev/trigger.dev/pull/3188
https://github.com/Srinivasan8888
Srinivasan8888https://github.com/Srinivasan8888
on Aug 31, 2026https://github.com/triggerdotdev/trigger.dev/issues/4627#issuecomment-5474451326
#4845https://github.com/triggerdotdev/trigger.dev/issues/4845
https://github.com/postdvk
postdvkhttps://github.com/postdvk
on Aug 31, 2026https://github.com/triggerdotdev/trigger.dev/issues/4627#issuecomment-5475117593
@bharathkumar39293https://github.com/bharathkumar39293
https://github.com/Srinivasan8888
Srinivasan8888https://github.com/Srinivasan8888
on Aug 31, 2026https://github.com/triggerdotdev/trigger.dev/issues/4627#issuecomment-5475236201
#4650https://github.com/triggerdotdev/trigger.dev/pull/4650
@bharathkumar39293https://github.com/bharathkumar39293
@leadingproblemsolverhttps://github.com/leadingproblemsolver
@aurumflux20https://github.com/aurumflux20
#4650https://github.com/triggerdotdev/trigger.dev/pull/4650
https://github.com/aurumflux20
aurumflux20https://github.com/aurumflux20
on Sep 1, 2026https://github.com/triggerdotdev/trigger.dev/issues/4627#issuecomment-5497679610
@postdvkhttps://github.com/postdvk
@bharathkumar39293https://github.com/bharathkumar39293
@bharathkumar39293https://github.com/bharathkumar39293
@YoadElkayamhttps://github.com/YoadElkayam
https://github.com/YoadElkayam/mcp-fuse/tree/main/sephttps://github.com/YoadElkayam/mcp-fuse/tree/main/sep
https://github.com/matt-aitken
matt-aitkenhttps://github.com/matt-aitken
on Sep 18, 2026https://github.com/triggerdotdev/trigger.dev/issues/4627#issuecomment-5730345887
#4952https://github.com/triggerdotdev/trigger.dev/pull/4952
#4953https://github.com/triggerdotdev/trigger.dev/pull/4953
matt-aitkenhttps://github.com/matt-aitken
completedhttps://github.com/triggerdotdev/trigger.dev/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 18, 2026https://github.com/triggerdotdev/trigger.dev/issues/4627#event-31390863732
https://github.com/aurumflux20
aurumflux20https://github.com/aurumflux20
on Sep 18, 2026https://github.com/triggerdotdev/trigger.dev/issues/4627#issuecomment-5732924372
#4952https://github.com/triggerdotdev/trigger.dev/pull/4952
#4953https://github.com/triggerdotdev/trigger.dev/pull/4953
aurumflux20https://github.com/aurumflux20
on Sep 19, 2026https://github.com/triggerdotdev/trigger.dev/issues/4627#event-31432636815
Index: Trigger.dev, found and fixed in 34 days — a documented claim, …https://github.com/aurumflux20/aurumflux20.github.io/commit/973c6c6e9c630c63d826afcdd50205579c5d2161
973c6c6https://github.com/aurumflux20/aurumflux20.github.io/commit/973c6c6e9c630c63d826afcdd50205579c5d2161
Sign up for freehttps://github.com/signup?return_to=https://github.com/triggerdotdev/trigger.dev/issues/4627
Sign in to commenthttps://github.com/login?return_to=https://github.com/triggerdotdev/trigger.dev/issues/4627
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.