Skip to content

[ 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).

terminal
pnpm add @vllnt/convex-idempotency
pnpm add @vllnt/convex-idempotency@canary

Register the component

Add it to your app’s convex/convex.config.ts, then run npx convex dev to generate the references.

convex/convex.config.ts
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.

Read the 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
WeekDownloads
14 June 2026 to 15 June 2026127
16 June 2026 to 22 June 2026392
23 June 2026 to 29 June 2026389
30 June 2026 to 6 July 2026377
7 July 2026 to 13 July 2026157
14 July 2026 to 20 July 2026264
21 July 2026 to 27 July 202624
28 July 2026 to 3 August 20265
4 August 2026 to 10 August 2026372
11 August 2026 to 17 August 2026195
18 August 2026 to 24 August 2026236
25 August 2026 to 31 August 2026811
1 September 2026 to 7 September 2026837
8 September 2026 to 14 September 20262,008
15 September 2026 to 21 September 2026622
22 September 2026 to 28 September 2026531
29 September 2026 to 5 October 2026230
6 October 2026 to 12 October 202658
13 October 2026 to 19 October 202681
20 October 2026 to 26 October 2026115
27 October 2026 to 2 November 2026459
3 November 2026 to 9 November 2026274
10 November 2026 to 16 November 2026100
17 November 2026 to 23 November 2026139

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
VersionKindPublished
0.1.1-canary.1d25c30canary31 October 2026
0.1.0stable1 September 2026
0.1.0-canary.7be2643canary1 September 2026
0.1.0-canary.cddffc2canary31 August 2026
0.1.0-canary.8b1feb6canary31 August 2026
0.1.0-canary.8868a8ccanary31 August 2026
0.1.0-canary.a6d4187canary16 June 2026
0.1.0-canary.cd0c5d5canary16 June 2026
0.1.0-canary.7b4acf1canary16 June 2026
0.1.0-canary.6abc175canary14 June 2026

Changelog

The newest stable releases of @vllnt/convex-idempotency, with the notes from its changelog.

  1. 0.1.0

    Added
    • First release of @vllnt/convex-idempotency.
    • Server-sourced time: begin/complete/purge read Date.now() inside each handler — no caller-supplied now — so a hostile clock cannot force a key to look live or expired.
    • Optional host resultValidator on the client, narrowing the opaque stored result to TResult at the boundary on complete (write), begin/get (read). Removes the previous unchecked as TResult cast.
    • 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). begin returns expiresAt/retryAfterMs on the inflight branch.
    • complete now returns a discriminated { recorded: true } | { recorded: false, reason: "missing" | "expired" | "already_done" }, plus an upsertOnMissing option 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
    • begin and complete now reject a TTL argument that is ≤ 0 or non-finite with ConvexError({ code: "INVALID_TTL" }). A zero or negative inflightTtlMs would have produced expiresAt ≤ now, immediately expiring the key on creation and breaking the dedup claim window. Same guard added for doneTtlMs in complete.
    Documented
    • Expiry check order asymmetry between begin and complete is now documented in TSDoc on both mutations. begin checks expiry before the done-state (an expired done key re-mints fresh — the grace window elapsed, the operation may re-run). complete checks the done-state before expiry (an expired done key returns already_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 _generated output as CLI-owned, exclude it from formatting, and expose a dedicated codegen script.
    • Require convex@^1.45.0.
All releases of @vllnt/convex-idempotency
Stable releases
RSSAtomJSON Feed
Canary builds
RSSAtomJSON Feed

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

Theme