[ CONVEX COMPONENT · STABLE · MIT ]
@vllnt/convex-idempotency
Exactly-once idempotency key ledger for retried operations
STABLE 0.1.0 · 1 GitHub star
Package details
Install
The untagged install gets the latest stable version (0.1.0). The canary tag tracks main (0.1.1-canary.1d25c30).
pnpm add @vllnt/convex-idempotency
pnpm add @vllnt/convex-idempotency@canaryRegister the component
Add it to your app’s convex/convex.config.ts, then run npx convex dev to generate the references.
import { defineApp } from "convex/server";
import idempotency from "@vllnt/convex-idempotency/convex.config";
const app = defineApp();
app.use(idempotency);
export default app;Use it
Usage, options and examples are in the package README.
Downloads
- Last 7 days
- 139
- Since first publish
- 8,803
Downloads per week since 14 June 2026, oldest on the left. Weeks count back from 23 November 2026, so the first one may be shorter than seven days.
139 downloads in the last 7 days. 8,803 downloads since 14 June 2026. Source: npm, counted through 23 November 2026.
Show downloads per week as a table
| Week | Downloads |
|---|---|
| 14 June 2026 to 15 June 2026 | 127 |
| 16 June 2026 to 22 June 2026 | 392 |
| 23 June 2026 to 29 June 2026 | 389 |
| 30 June 2026 to 6 July 2026 | 377 |
| 7 July 2026 to 13 July 2026 | 157 |
| 14 July 2026 to 20 July 2026 | 264 |
| 21 July 2026 to 27 July 2026 | 24 |
| 28 July 2026 to 3 August 2026 | 5 |
| 4 August 2026 to 10 August 2026 | 372 |
| 11 August 2026 to 17 August 2026 | 195 |
| 18 August 2026 to 24 August 2026 | 236 |
| 25 August 2026 to 31 August 2026 | 811 |
| 1 September 2026 to 7 September 2026 | 837 |
| 8 September 2026 to 14 September 2026 | 2,008 |
| 15 September 2026 to 21 September 2026 | 622 |
| 22 September 2026 to 28 September 2026 | 531 |
| 29 September 2026 to 5 October 2026 | 230 |
| 6 October 2026 to 12 October 2026 | 58 |
| 13 October 2026 to 19 October 2026 | 81 |
| 20 October 2026 to 26 October 2026 | 115 |
| 27 October 2026 to 2 November 2026 | 459 |
| 3 November 2026 to 9 November 2026 | 274 |
| 10 November 2026 to 16 November 2026 | 100 |
| 17 November 2026 to 23 November 2026 | 139 |
Release history
Every release on a timeline, oldest on the left. A tall mark with its version is a stable release; a short mark is a canary build. The time axis is the one of the downloads chart, so a release stands above the week it shipped in.
1 stable release and 9 canary builds since 14 June 2026. Latest stable: 0.1.0 on 1 September 2026.
Show every release as a table
| Version | Kind | Published |
|---|---|---|
| 0.1.1-canary.1d25c30 | canary | 31 October 2026 |
| 0.1.0 | stable | 1 September 2026 |
| 0.1.0-canary.7be2643 | canary | 1 September 2026 |
| 0.1.0-canary.cddffc2 | canary | 31 August 2026 |
| 0.1.0-canary.8b1feb6 | canary | 31 August 2026 |
| 0.1.0-canary.8868a8c | canary | 31 August 2026 |
| 0.1.0-canary.a6d4187 | canary | 16 June 2026 |
| 0.1.0-canary.cd0c5d5 | canary | 16 June 2026 |
| 0.1.0-canary.7b4acf1 | canary | 16 June 2026 |
| 0.1.0-canary.6abc175 | canary | 14 June 2026 |
Changelog
The newest stable releases of @vllnt/convex-idempotency, with the notes from its changelog.
0.1.0
Added
- First release of
@vllnt/convex-idempotency. - Server-sourced time:
begin/complete/purgereadDate.now()inside each handler — no caller-suppliednow— so a hostile clock cannot force a key to look live or expired. - Optional host
resultValidatoron the client, narrowing the opaque storedresulttoTResultat the boundary oncomplete(write),begin/get(read). Removes the previous uncheckedas TResultcast. - Split TTLs: a short inflight lease (
inflightTtlMs, default 60s) so a crashed worker's claim self-heals fast, and a longer done grace (doneTtlMs, default 24h).beginreturnsexpiresAt/retryAfterMson theinflightbranch. completenow returns a discriminated{ recorded: true } | { recorded: false, reason: "missing" | "expired" | "already_done" }, plus anupsertOnMissingoption to record finished work whose inflight row had vanished.- Expired keys are re-minted in place (
db.patch, reusing the row id) instead of delete-and-insert. - Bounded, self-rescheduling
purge(take(batch)+ scheduler) and a built-in daily prune cron (crons.ts); idempotent.
Fixed
beginandcompletenow reject a TTL argument that is ≤ 0 or non-finite withConvexError({ code: "INVALID_TTL" }). A zero or negativeinflightTtlMswould have producedexpiresAt ≤ now, immediately expiring the key on creation and breaking the dedup claim window. Same guard added fordoneTtlMsincomplete.
Documented
- Expiry check order asymmetry between
beginandcompleteis now documented in TSDoc on both mutations.beginchecks expiry before the done-state (an expired done key re-mints fresh — the grace window elapsed, the operation may re-run).completechecks the done-state before expiry (an expired done key returnsalready_done— a prior winner's recorded outcome must not be overwritten).
Fixed (since the first canary)
- Fence re-minted leases with opaque claim IDs so a stale worker cannot overwrite the newer claim's result, including when lost-claim upsert is enabled.
- Reject invalid purge batches and non-finite cutoffs before they can create scheduler loops or oversized transactions.
Changed (since the first canary)
- Treat Convex
_generatedoutput as CLI-owned, exclude it from formatting, and expose a dedicated codegen script. - Require
convex@^1.45.0.
- First release of
Licence
Released under the MIT licence. The full text is in the source repository.
[ PACKAGE ]
- Stable
- 0.1.0
- Canary
- 0.1.1-canary.1d25c30
- GitHub stars
- 1 GitHub star
- Licence
- MIT
- Issues
- Open an issue