@voltro/plugin-cdc-out 0.53.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +195 -0
- package/dist/index.js +120 -119
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -39,6 +39,201 @@ _Changes staged for the next release accumulate here (rolled up from
|
|
|
39
39
|
|
|
40
40
|
---
|
|
41
41
|
|
|
42
|
+
## [0.54.0] — 2026-08-27
|
|
43
|
+
|
|
44
|
+
### ⚠ BREAKING
|
|
45
|
+
|
|
46
|
+
- **@voltro/local-first** — **`CrdtDocHandle.onUpdate` now tells its handler whether the update was LOCAL.** The signature gains a second argument: `onUpdate((update, { local }) => …)`. `local: false` means the blob came from folding somebody else's state through `applyState`.
|
|
47
|
+
|
|
48
|
+
Without it, an echo guard could not be written correctly on the public surface. Applying a peer's update fires the same handler a local edit does, so an app pushing from `onUpdate` re-broadcasts what it just received — measured with three tabs open, one keystroke produced three server writes instead of one. It converges (the merge is idempotent), but the amplification scales with the session.
|
|
49
|
+
|
|
50
|
+
The only app-level workaround was an `applying` boolean around `applyState`, and that is correct **only** while the backend emits synchronously — a property `CrdtBackend` deliberately does not promise ("the backend decision lives behind our abstraction so it can change"). So the flag had to come from the backend: the yjs one tags its own folds with a symbol origin and reports anything else as local.
|
|
51
|
+
|
|
52
|
+
`codemod: none` — the parameter is ADDITIVE. An existing single-argument handler keeps compiling and keeps behaving exactly as before; there is nothing to rewrite. Read the flag when you push from `onUpdate`, which is what `useCrdtDoc` does for you.
|
|
53
|
+
- **@voltro/local-first** — **`RUNTIME_SEAMS` lists ONE seam now, not three** — `['sync-transport-app-tags']`. `RuntimeSeam` narrows with it. The two removed entries left in opposite directions, and `seams.ts` was asserting both halves of the contradiction at once: its `DONE` prose said the presence broker binding shipped while the array beside it still named `presence-broker-binding` as open.
|
|
54
|
+
|
|
55
|
+
- `presence-broker-binding` is BUILT. `usePresenceChannel` (`@voltro/plugin-presence/web`) rides the framework's own presence lane, so cross-replica fan-out belongs to the broadcast plugin and there is one presence wire rather than two; the shape is pinned by `presence/channelParity.test-d.ts`. - `wasm-sqlite-durable-adapter` was REJECTED, with the reasoning recorded in `mirror/queryMirror.ts`: the client's query surface is `(tag, input)` and predicates never exist client-side, so a browser SQL engine would evaluate a language the client never sees. A decision is not a gap, and listing it as one invites somebody to close it. A SQLite BACKING beneath `KvStore` remains available and is a different door.
|
|
56
|
+
|
|
57
|
+
`codemod: none` because nothing in the framework reads this constant and nothing asks a user to: it is a documentation manifest that happens to be typed. There is no mechanical rewrite for a removed member of one — the correction is the sentence above.
|
|
58
|
+
|
|
59
|
+
The docs site's "what's shipped vs. a runtime seam" table carried the same two rows in both languages and now carries one, with both departures stated rather than silently dropped: "we have not built it" and "we decided against it" are different answers and a reader is entitled to know which one applies.
|
|
60
|
+
|
|
61
|
+
### Added
|
|
62
|
+
|
|
63
|
+
- **@voltro/content, @voltro/cli** — **Relative images inside markdown content are copied into the build, and their `src` rewritten to the copy.** `` now lands in `dist/assets/content-media/<hash>.<ext>` and the rendered HTML points there. `voltro dev` serves the same URL shape on demand from the source file, so a page's HTML does not change between development and a build.
|
|
64
|
+
|
|
65
|
+
Nothing moved those files before: the artifact emit wrote JSON and the renderer emitted the relative src verbatim, so a built blog asked the browser for a path that exists only in the source tree — while `routing/assets.md` said, in both languages, that the content pipeline copied and hashed them.
|
|
66
|
+
|
|
67
|
+
A reference to a file that does not exist now FAILS the build and names the path. The alternative — emit the src and continue — is the defect itself: the page renders, the browser 404s, and the build says nothing.
|
|
68
|
+
|
|
69
|
+
Absolute (`/…`) and remote sources are untouched; they are not the build's to move. Copy and content-hash only — build-time transformation (resize / format) remains a named non-goal for markdown content, because a markdown reference carries no width and no `sizes` to derive one from. The `?image` pipeline stays the answer where that matters.
|
|
70
|
+
|
|
71
|
+
Renderers outside the framework's build are unaffected: `@voltro/content` exposes this as a registered resolver (`setContentAssetResolver`), and with none registered a relative src is left exactly as written rather than rewritten to a path nothing serves.
|
|
72
|
+
- **@voltro/cli, @voltro/runtime** — **The server-side CRDT compaction threshold is an `app.config.ts` field now, not an environment variable only.** `crdt.compactMaxBytes` (default 512 KiB, `0` disables) decides when a merged `crdtText()` / `crdtDoc()` blob is soft-compacted — re-encoded through a live doc, same lineage, so every outstanding client update still merges. `VOLTRO_CRDT_COMPACT_MAX_BYTES` still wins over it: an operator acting on a running deployment outranks what the project declared.
|
|
73
|
+
|
|
74
|
+
This is the standing rule ("every number the framework picks on your behalf is a config field with a default, plus an env override"), applied to the one knob that had only the environment half. A threshold sized for a document shape is a property of the project, so it belongs in a file a reviewer reads and a deploy carries — not in whatever `env:` block somebody remembered to set.
|
|
75
|
+
|
|
76
|
+
Resolved by ONE builder both boot paths call (`wireCrdtTunables`), registered into the process slot the merge path reads — the `wireReactiveSocketTunables` shape, for the reason that shape exists: two paths resolving a value separately is how they come to disagree. `setCrdtCompactMaxBytes` was exported and called by nothing before this; the runtime kept a lazy env read for a process that never runs a boot path (a unit test), and that remains the fallback rather than a second answer.
|
|
77
|
+
|
|
78
|
+
Note `0` is a value here, not an absence — it means "do not compact" — so the resolver's floor is `>= 0` on both the config and the env side. The `> 0` floor the other tunables use would have silently dropped a declared zero.
|
|
79
|
+
- **@voltro/cli** — **The gRPC surface's shutdown drain budget is configurable — `grpc.drainMs` (default 5000, `0` forces immediately, env `VOLTRO_GRPC_DRAIN_MS`).** It was a `5_000` literal in the `stop()` closure.
|
|
80
|
+
|
|
81
|
+
It is a knob rather than a measured constant, and the distinction is worth stating because the framework deliberately refuses knobs elsewhere on the same page (compression levels are fixed — "a knob nobody can pick correctly is worse than a measured default"). A compression level has no input outside the process. A drain budget has two, and neither is ours: the orchestrator's termination grace, past which SIGKILL arrives and a longer budget is decorative; and the app's longest legitimately in-flight call, below which every rolling deploy force-closes work that would have finished. The default fits the 30 s grace both kubernetes and `docker stop` default to.
|
|
82
|
+
|
|
83
|
+
The `grpc:` config shape was also declared THREE times — `ApiAppConfig`, `ServeApiOptions` and the shared builder's options — which is how a field lands on two of them. It is one exported `GrpcSurfaceConfig` now, referenced by all three, so the shared builder both boot paths already call is the only thing that reads it.
|
|
84
|
+
|
|
85
|
+
The boot line and the budget-exceeded warning both name the resolved value, so what a process will wait is visible before the shutdown rather than after it.
|
|
86
|
+
- **@voltro/cli** — **Partial prerendering's counters are now real metrics — they were incremented by both boot paths and read by nothing, while the observability docs listed them among the exportable ones.** A reader who went looking for them at the OTLP or Prometheus endpoint found nothing there: `pprMetrics()` was a `globalThis` counter slot with no registry bridge, no inspect endpoint and no log line.
|
|
87
|
+
|
|
88
|
+
Five series, all labelled `page` — the DECLARED route pattern (`/blog/[slug]`), never a resolved URL: `voltro_ppr_shell_serves_total`, `voltro_ppr_hole_passes_total`, `voltro_ppr_hole_settles_total`, `voltro_ppr_hole_errors_total`, and the `voltro_ppr_hole_pass_seconds` histogram. They land in Effect's global `MetricRegistry`, so `@voltro/plugin-prometheus`' `GET /metrics` and `GET /_voltro/inspect/metrics` both see them with nothing to register — the same placement `@voltro/database` uses for `voltro_db_*`.
|
|
89
|
+
|
|
90
|
+
`voltro_ppr_hole_errors_total` is the one to alert on, and it is a separate series rather than a `status` label for a reason: a failed hole pass is invisible from outside. The shell is already on the wire with a `200`, so the page renders and every `<Await>` boundary silently stays on its fallback forever.
|
|
91
|
+
|
|
92
|
+
Two things changed beyond the bridge. The last/max latency PAIR is gone in favour of the histogram — a last value plus a monotonic max answers strictly less, and the max never comes back down. And `voltro dev` now counts shell serves too; the counter previously existed only on the `voltro start` path, which for a metric is the silent kind of drift (the series simply reads zero).
|
|
93
|
+
|
|
94
|
+
The `globalThis` slot is deleted rather than kept beside the registry: two counters for one fact is how a dashboard and a scrape target come to disagree.
|
|
95
|
+
- **@voltro/plugin-presence** — `resolveMember` now receives the app's `store`, and `identityFields:` closes the hole in the obvious resolver.
|
|
96
|
+
|
|
97
|
+
Both from a deployment that adopted the hook and reported what it cost them.
|
|
98
|
+
|
|
99
|
+
**The store.** The resolver's whole job is a by-id read, and `app.config.ts` — where it is declared — is evaluated long before a migrated `DataStore` exists. The workaround is a module cell filled from a `*.startup.ts`; the plugin already receives the store through `bindDataStore`, so it hands it to the resolver instead: `resolveMember: ({ subject, store }) => …`.
|
|
100
|
+
|
|
101
|
+
**The hole.** Resolved fields merge OVER the caller's `meta`, so a key the resolver does not return keeps whatever the client sent. A resolver returning only what it found — `{ userName }` for a user with no avatar — therefore leaves a caller-supplied `avatarUrl`, or a `userName` the resolver has never heard of, standing in the roster every other member reads. That is the exact substitution the hook exists to prevent, and the doc comment's promise ("a caller cannot override what the server says about them") was broader than the behaviour: it holds only for the keys returned on that call.
|
|
102
|
+
|
|
103
|
+
`identityFields: ['userName', 'avatarUrl']` names the keys the SERVER owns. They are stripped from the caller's `meta` BEFORE the merge, so the answer is the same on every call whether or not the resolver produced a value. Ignored without a `resolveMember` — with no server identity to protect, stripping a client field would only delete data the app put there deliberately. Returning every identity key (`null` where you have no value) remains the alternative, and is what the reporting deployment did.
|
|
104
|
+
- **@voltro/plugin-queue** — **Queue consumers now export Prometheus series and open one tracing span per message, continuing the producer's trace.** Both were specified and neither was built: `voltro_queue_consumed_total` had zero occurrences anywhere in the repo, and `traceparent` was copied out of the message headers onto `ctx.traceparent` — a value a handler can forward by hand, not a trace. A Kafka hop was where every distributed trace ended.
|
|
105
|
+
|
|
106
|
+
Four series, all in Effect's global `MetricRegistry` (so `GET /metrics` and `GET /_voltro/inspect/metrics` both see them): `voltro_queue_consumed_total{topic,outcome}`, `voltro_queue_retries_total{topic}`, `voltro_queue_produced_total{topic}` and the `voltro_queue_lag_messages{topic,partition}` gauge.
|
|
107
|
+
|
|
108
|
+
`outcome` is a closed two-value union — `ok` and `dead-lettered` together are every message the runner finished with, so the dead-letter rate is a division with no second series to join. A message abandoned by a REBALANCE is deliberately in neither: it was not consumed here, its new owner redelivers and counts it there, and counting it twice would make that ratio wrong in the direction of looking healthy.
|
|
109
|
+
|
|
110
|
+
Lag costs no extra round trip — `highWatermark` already rides along in the fetch response, so it is arithmetic on data the provider was handed. It is recorded in the provider rather than the runner because that is the only layer holding the watermark; the runner could only get it by asking the broker. Offsets are parsed as `BigInt` so a long-lived topic cannot lose precision, and an unparseable pair records nothing rather than a zero: "no lag" and "we could not tell" must not read the same.
|
|
111
|
+
|
|
112
|
+
The per-topic inspect counters stay, and each fact is now moved by exactly ONE recorder that writes both the slot and the series, so the dashboard and the scrape target cannot drift.
|
|
113
|
+
|
|
114
|
+
Each message is processed inside a `queue.consume` span whose parent is the incoming `traceparent`, parsed by the same `externalSpanFromTraceparent` the inbound-webhook path uses — so a malformed or all-zero header means "no parent" (a fresh root span), never a failed message. The span covers the whole message including retries and the dead-letter publish, and carries the OTel `messaging.*` attributes plus `voltro.queue.outcome`. The topic is an attribute, not part of the span name.
|
|
115
|
+
|
|
116
|
+
Known limit, measured rather than assumed: a span opened from DETACHED work does not reach an OTLP exporter, because the framework's tracer is a `Layer` provided only inside the rpc server's scope. This is framework-wide (`cdcOut.deliver` and `plugin.<name>.schedule-fire` are the same shape) and is stated in the queue docs rather than implied away. The metrics are unaffected — the metric registry is a process global.
|
|
117
|
+
- **@voltro/runtime, @voltro/voltro** — `setRowFilter({ …, tables: ['bookmarks', 'recentSearches'] })` — declare which tables your filter may narrow, and delta-resume survives everywhere else.
|
|
118
|
+
|
|
119
|
+
Delta-resume is excluded for a subscription whose row set is re-resolved per delivery: replaying deltas could serve rows the subject has since lost. But the question the runtime could ask was only "is a filter registered in this process?", so ONE registration disabled cheap reconnects for every subscription in the app — a deployment measured a filter narrowing 4 tables costing the feature on all 173 of their query descriptors, 55 of whose source tables the filter never touches.
|
|
120
|
+
|
|
121
|
+
The exclusion is per table now. A declared filter keeps resume for every subscription whose source is not in its set; an undeclared filter keeps today's conservative behaviour (the runtime cannot know which tables the predicate may reach, and "unknown" must read as "yes").
|
|
122
|
+
|
|
123
|
+
**Declared, not probed** — and the difference is soundness, not taste. Resolving the scope at subscribe and treating `predicate(ctx, source) === undefined` as safe is the cheaper version: it is wrong, because the predicate is a function of freshly loaded context, so a table it does not narrow now may be narrowed on the next delivery — which is the entire reason the filter is re-resolved per delivery. A static list is a promise about every future resolution, and the runtime holds the app to it: a predicate returned for an undeclared table raises the new `RowFilterDeclarationViolated` at the read that did it (the request fails, a subscription is revoked) rather than serving rows under a resume grant the declaration no longer earns.
|
|
124
|
+
|
|
125
|
+
Eager loads (`.with(...)`) stay excluded wholesale — a relation resolves below the seam that narrows (see the sibling entry).
|
|
126
|
+
|
|
127
|
+
`apiSurface: compatible` — the golden also picks up `subscribeDescriptor` gaining its `reauthorize`/`refilter` parameters, which landed in the SSE/gRPC row-filter fix without a regeneration. That member is a framework-internal transport binding: the only implementors are the two boot paths (`serveApi.ts`, `dev.ts`), both already passing the new arguments. No user code implements or calls it, so no code that compiled stops compiling.
|
|
128
|
+
- **@voltro/local-first** — **`useCrdtDoc` — the transport half `useCrdtEditor` had no partner for.** `useCrdtEditor({ doc })` takes a `CrdtDocHandle` and owns the editor lifecycle; getting that handle wired to a server was app-level glue until now. Import it from `@voltro/local-first/react`:
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
const shared = useCrdtDoc({
|
|
132
|
+
cell: { table: 'documents', id, column: 'body' },
|
|
133
|
+
remote: row.data?.body ?? null, // the reactive query streaming the row
|
|
134
|
+
push: (w) => save.mutate({ id: w.id, update: w.update }),
|
|
135
|
+
})
|
|
136
|
+
// in a CHILD component, so useCrdtEditor is never a conditional hook call:
|
|
137
|
+
const editor = useCrdtEditor({ doc })
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
It returns `{ doc, loaded, outstanding, synced, setOnline }`. `doc` is `null` until the mount effect has run — the document is built in an effect, never during render, which is what a rich-text binding gets wrong first (constructing during render crashes a prerender and leaves a second instance alive under StrictMode).
|
|
141
|
+
|
|
142
|
+
**It is `createSyncClient`-backed, not new glue.** The four-line hand-rolled version loses the offline queue, the bounded retry, `outstanding`/`synced`, the per-cell coalescence that drains 1000 offline keystrokes as O(1) pushes, durable persistence, and the discipline that a `null` row means NOT LOADED rather than an empty document — fold an empty document over a loading row and the first keystroke can push a state that erases what was stored.
|
|
143
|
+
|
|
144
|
+
**The echo guard is the part that could not be written outside the package until now.** A `crdtDoc()` handle is mutated by the EDITOR, so local edits arrive as `onUpdate` callbacks — and folding a peer's state through `applyState` fires the same callback. The hook pushes only when `local` is true. Without that, every client re-broadcasts what it just received.
|
|
145
|
+
|
|
146
|
+
`useCrdtText` and `useCrdtDoc` now build their sync client through one shared internal seam rather than two copies of the same transport wiring.
|
|
147
|
+
|
|
148
|
+
### Fixed
|
|
149
|
+
|
|
150
|
+
- **@voltro/runtime** — A row filter was bypassed for any table reached through `.with(...)`.
|
|
151
|
+
|
|
152
|
+
The filter is AND-merged onto a read's BASE table by the store middleware; an eager load is resolved BELOW that seam — the memory store recurses through its own raw read, the SQL stores fold the relation into one join — so the relation's rows never passed the code that would narrow them. Measured on one data set: a filter restricting `readers` to the caller returned exactly the caller's row on a direct read and BOTH rows through `.with({ readers: true })`.
|
|
153
|
+
|
|
154
|
+
Applying the filter inside eager compilation is the real fix and it is a per-dialect change. Until then the read REFUSES rather than serves, naming the table and both ways out (read it as its own query, or drop it from the `.with(...)`). Only relations reaching a table the filter actually narrows are affected; every other eager load is untouched, and an app with no filter pays nothing.
|
|
155
|
+
|
|
156
|
+
Silent exposure is the one outcome that must not survive the gap — the same reasoning that makes this module refuse to fail open when `load` fails.
|
|
157
|
+
- **@voltro/cli** — **The AGENTS.md seeder executed every app's `app.config.ts`, so seeding one app could stop another from booting.** It walked `apps/<proj>/<app>` for the whole workspace and `import()`ed each config to read its `plugins:` list. An `app.config.ts` is not inert: it imports the app's schema, which calls `databaseHandle(...)`, which REGISTERS every table. Two apps that each declare an `actors` table therefore collided —
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
duplicate table 'actors' registration: two different table descriptors claim the same name.
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
— and the app being booted was the one that failed. A reference project could not start at all.
|
|
164
|
+
|
|
165
|
+
The seeder parses the config now instead of importing it, resolving each plugin's package by pairing the identifiers called inside the `plugins: [...]` block with the import that introduced them (so a renamed import still lands on the right package), and reading the `{ name: '…' }` form directly. A plugin it cannot attribute is dropped rather than guessed: the index is a filter, and a wrong row is worse than a missing one.
|
|
166
|
+
|
|
167
|
+
The rule this encodes: **a step that writes documentation must not execute application modules.** Nothing about composing an index needs a config's runtime value, and the sibling app-discovery pass was already reading the same file as text for its `type:` check.
|
|
168
|
+
|
|
169
|
+
Worth knowing for the next diagnosis: two different descriptors for one name reads like one module evaluated twice, so the investigation went looking for split module identity (pnpm symlink vs real path, ESM cache keying). It was two DIFFERENT apps, pulled in by a documentation step — found by tracing what actually resolved, not by reasoning about what could.
|
|
170
|
+
- **@voltro/cli** — **`voltro build` read the PREVIOUS build's config, so every `app.config.ts` change landed one build late.** `loadConfig` prefers the precompiled `.framework/dist/server/appConfig.js` when it exists — correct for `serve` / `start`, which cannot read TypeScript, and exactly wrong for the command that WRITES that file. Anything consumed before the config is recompiled took the stale value: `fonts`, `images`, `seo`, `theme`, `locales`.
|
|
171
|
+
|
|
172
|
+
Silent in the worst way: the second build is always right, so the symptom is "my change did nothing" followed by "…and now it works", with no error either time. Measured by setting `title` to a probe value, building, and finding the old title in the generated shell.
|
|
173
|
+
|
|
174
|
+
`voltro dev` already carried this fix, with the reasoning written on the option itself. The build path is the one that makes the artefact, so it is the last place that should trust it.
|
|
175
|
+
- **@voltro/local-first** — **`useCrdtEditor` built its editor during RENDER, so a default page could not mount it and StrictMode leaked one.** The Tiptap instance was constructed inside a `useMemo`, which runs while rendering. Two consequences, both real:
|
|
176
|
+
|
|
177
|
+
- **Server render threw.** Tiptap needs `window`; a page mounting this hook failed prerender with `there is no window object available`. `renderMode` defaults to `'static'`, so that is the ordinary page, not an exotic one. - **React's double-invoked render built TWO editors** and the cleanup destroyed only the last, leaving the first alive holding its Yjs binding. `useCrdtText`'s own comment documents exactly this shape as a bug; the editor had it anyway.
|
|
178
|
+
|
|
179
|
+
Construction moved into an effect, and the cleanup destroys THAT instance rather than whatever the ref currently holds — reading the ref destroys the new editor on a rebuild and leaves the old one running.
|
|
180
|
+
|
|
181
|
+
`extensions` is no longer a dependency. Callers pass an inline array literal, which is a fresh identity every render, so listing it rebuilt the whole editor per keystroke; it is read at construction from a ref instead. The trade is stated rather than hidden: changing `extensions` after mount does not rebuild the editor — remount with a `key` if you need that.
|
|
182
|
+
|
|
183
|
+
**`CrdtDocHandle` is exported now.** It is the parameter type of `useCrdtEditor`, and it was declared, used across the package, and exported from nowhere — visible in the built `.d.ts` only as a bare `declare interface`, which no import can reach. An app binding an editor could not type its own variable.
|
|
184
|
+
- **@voltro/cli** — `middleware.ts`'s `cspNonce` now reaches the scripts in a STREAMED response's `<head>`. Both boot paths handed the nonce to React — which stamps only the scripts React itself emits — and not to the driver that composes the head, so on the arm a plain `renderMode: 'ssr'` page takes, `renderDeferredRegistryScript()` (executable inline JS) and the `__voltro_state__` payload went out bare under the very `script-src 'nonce-…'` policy the same response set. A deferring page's registry was therefore the one script the browser refused to run. The `renderMode: 'spa'` layout-shell arms were unstamped end to end for the same reason and are fixed with them.
|
|
185
|
+
|
|
186
|
+
`stampScriptNonce` also stops mistaking `data-nonce="…"` or a `?nonce=` query parameter for a nonce attribute, which left exactly the tags a policy then blocked unstamped.
|
|
187
|
+
|
|
188
|
+
Still open, and now documented rather than implied: the settle `<script>` an `<Await>` boundary emits inside the streamed body is part of the rendered tree, so neither stamper reaches it — `defer()` and `cspNonce` do not compose yet.
|
|
189
|
+
- **@voltro/runtime, @voltro/cli, @voltro/plugin-queue, @voltro/plugin-cdc-out** — **A span opened by detached work reached no exporter.** The tracer is a `Layer` provided at `startRpcServer`'s outermost scope, so `Effect.withSpan` inside a handler resolves the configured OpenTelemetry tracer. Work that runs OUTSIDE a request fiber — a broker callback, a schedule firing, a CDC delivery — reaches Effect through its own `runPromise`, which resolves the DEFAULT tracer: it creates spans and hands them to nobody. Measured against a live tracing layer: **0 finished spans**, for three framework span sites that all read as instrumented (`queue.consume`, `cdcOut.deliver`, `plugin.<name>.schedule-fire`).
|
|
190
|
+
|
|
191
|
+
The server now publishes its tracer instance into a process cell (`globalThis` + `Symbol.for`, for the same duplicate-instance reason `coreTablesRegistry` and the row filter are there), and detached work runs under it via `withServerTracer`. That is exactly the correction the LOGGER already had one line over in `rpcServer.ts` — detached fibers "start from the default runtime and carry their own", and were given one; the tracer never was.
|
|
192
|
+
|
|
193
|
+
Not a second provider: a per-plugin tracer means a second `NodeTracerProvider` with an exporter nothing flushes at shutdown, and global OTel registration is refused on purpose. There is one tracer, built where it always was.
|
|
194
|
+
|
|
195
|
+
`withServerTracer` is a no-op when nothing is published — a unit test, an embedder, a process with no rpc server — never a throw and never a second tracer. Pinned by `serverTracer.test.ts`, whose second case drives the defect directly: without the wrapper, the same span never reaches the tracer under test.
|
|
196
|
+
- **@voltro/local-first** — **`useCrdtEditor` was unreachable from a published install.** `@voltro/local-first`'s source `exports` map carried `./editor`, its `publishConfig.exports` — the map an npm install actually resolves — carried only `.` and `./react`, and the build emitted no editor bundle. So the rich-text editor binding worked inside this monorepo (where `workspace:*` resolves the source map) and gave every user `ERR_PACKAGE_PATH_NOT_EXPORTED`, while the docs taught it.
|
|
197
|
+
|
|
198
|
+
`editor` is a build entry now, `./editor` is in the published exports, and it has its own api-extractor report so the surface is checked like the other two. An entry point that is documented and not built is a feature that exists for nobody outside this repo, and the two maps diverging is the shape that hides it: the one you read is not the one users resolve.
|
|
199
|
+
- **@voltro/web** — `responseHeaders` and `cspNonce` are on the type users actually write against.
|
|
200
|
+
|
|
201
|
+
The CSP-nonce and response-header feature shipped with its fields declared in the CLI's internal `MiddlewareResult` and NOT in the one `@voltro/web/middleware` publishes — the type `defineMiddleware` checks a user's `run` against. The runtime honoured both fields; the compiler refused them. So the documented way to set a `Content-Security-Policy` from middleware produced TS2322, and the only way to use a working feature was to cast around its own type.
|
|
202
|
+
|
|
203
|
+
Two definitions of one shape is what allowed it: the half that gained the feature is not the half a user writes against. The published type carries both fields now, with the same documented limits (a prerendered `static` file is served without a render, so no middleware runs; `cspNonce` is `ssr` only, because an isr render is cached and a cached nonce is a lie the browser enforces).
|
|
204
|
+
|
|
205
|
+
Caught by the `web-layout-loader` fixture, which is the only place that writes this type the way a user does.
|
|
206
|
+
- **@voltro/cli** — `voltro mobile <dir>` read its directory with a predicate that treats every flag as valued.
|
|
207
|
+
|
|
208
|
+
The command found its root with a hand-rolled scan — first argument that does not start with `-` and is not preceded by a `--flag`. Two things go wrong with that shape, and `cliPositionalFlagSafety.test.ts` exists because they have gone wrong before:
|
|
209
|
+
|
|
210
|
+
- it treats a BOOLEAN flag as consuming the next argument, so `voltro mobile links --help ./app` decided `./app` was `--help`'s value and silently fell back to `process.cwd()`; - it matched with `indexOf`, the FIRST occurrence, so an argument whose text appears twice was judged by the wrong position.
|
|
211
|
+
|
|
212
|
+
It uses `firstPositional(args, VALUED_FLAGS)` now, with the three flags that actually take a value declared rather than inferred.
|
|
213
|
+
- **@voltro/database** — Adding a `.default(…)` to an EXISTING `text()` column no longer kills the migration on MySQL. MySQL refuses a DEFAULT on a TEXT/BLOB column outright (`BLOB, TEXT, GEOMETRY or JSON column 'x' can't have a default value`), where MariaDB allows it — so the same declaration applied on one engine and failed mid-migration on the other. `CREATE TABLE` has always answered this by widening such a column to `VARCHAR(255)` (`NVARCHAR(450)` on SQL Server, where the reason is indexability); the ALTER path now applies that same answer, reshaping the column to the declared shape instead of setting a default on whatever the column happened to be. A column therefore ends up with the same type whether the default was declared before or after the table existed. Postgres (TEXT takes a DEFAULT) and SQLite (rebuilds to the declared shape) are unchanged. Note the narrowing: on mysql/mariadb the column becomes `VARCHAR(255)`, so the ALTER fails loudly if an existing row is longer — use `text().maxLength(n)` to choose the width. The same widening rule also reached `ADD COLUMN`, which on SQL Server had emitted `NVARCHAR(MAX)` for a column `CREATE TABLE` renders as `NVARCHAR(450)`.
|
|
214
|
+
- **@voltro/cli** — **Validation errors on the no-JavaScript form path rendered in English on every locale.** `validateFields` resolves message ids through a locale whose default is `documentLocale()` — it reads `<html lang>`, and outside a browser that is always `'en'`. The `/form/*` handler runs on the server, so a German page's 422 came back with English field errors while the same form with JavaScript rendered German; the flash carries the resolved strings, so hydration kept them.
|
|
215
|
+
|
|
216
|
+
The handler now resolves the locale from THIS request through the same resolver the surrounding page render and the ISR cache key already use (cookie › `Accept-Language` › the app's default). It is a required option on `makeFormPostHandler` rather than an optional one: both boot paths mount that handler separately, and an option nobody has to pass is one a new mount silently omits — landing straight back on the browser default. An app with no `locales` configured answers `'en'` explicitly.
|
|
217
|
+
|
|
218
|
+
**Under URL-prefix i18n the referring path outranks that chain.** There the language IS the URL (`/de/todos`) and the cookie may say something else entirely, so a cookie-only answer renders errors for a page the user is not on. The handler passes the referer's path to the resolver and both boot paths check it against the app's declared `locales` first, through one shared `localeFromPathPrefix` — a first segment that is not a declared locale (`/design/…`) falls through to the cookie chain rather than being mistaken for one. This is the "referer path vs. locale cookie" question the no-JS form work left open; the answer is both, in that order.
|
|
219
|
+
- **@voltro/client** — `useOutbox`'s `resolveConflict(id, input)` now actually replays the entry it resolved. It replayed against the pre-resolution queue — `replay` reads the queue through a ref, and the `setQueue` beside it had not landed yet — so the entry it was handed was still `conflict`, `replayable()` stopped at it, and nothing was sent. The resolution then sat in the queue as `pending` with no further replay scheduled, and every write queued behind it stayed blocked with it: a conflict that could be resolved in the UI and never left the device.
|
|
220
|
+
- **@voltro/runtime, @voltro/cli** — **A subscription opened over SSE or gRPC ignored the registered row filter — every read, not just the first.** `dispatcher.subscribe` resolves row visibility itself and treats a missing `refilter` as "this app has no row filter", so it read the descriptor unnarrowed. The WebSocket path always supplied one (`bindSubscription`'s `defaultRefilter`); the SSE and gRPC projections go through `makeQuerySubscriber`, whose `subscribeDescriptor` callback passed three arguments and dropped the trailing pair. Both boot paths were affected identically, so nothing a dev/serve parity check looks at could see it.
|
|
221
|
+
|
|
222
|
+
The same omission dropped the per-delivery guard re-check, which `data/grpc.md` and the 0.53.0 notes stated as a property: a revoked scope did not end a descriptor-query stream on those two transports. Computed queries were never affected (they re-run their handler, guards included), and neither was any app without a registered row filter.
|
|
223
|
+
|
|
224
|
+
Three things changed. `makeDefaultRefilter` moved to `@voltro/runtime`'s `rowFilter` module — it was private to the WebSocket entrypoint, and the transports that could not reach it are exactly the ones that went unfiltered. `QuerySubscriberDeps.subscribeDescriptor` takes the reauthorizer and the refilter as REQUIRED parameters, so a future transport cannot omit them by writing a shorter callback. And `dispatcher.subscribe` now THROWS, by name, when no refilter is passed while a filter is registered: reading unfiltered on purpose is available, but has to be said out loud with `NO_ROW_FILTER`. That is the same correction `ctx.rowFilter` already carries one layer up — `undefined` may mean "this app has none", never "the caller forgot".
|
|
225
|
+
|
|
226
|
+
Pinned by `subscriberTransportRefilter.test.ts`, which drives a real dispatcher through a store that evaluates predicates and asserts the foreign row never crosses the wire in ANY frame, with a positive control so an empty stream cannot pass.
|
|
227
|
+
- **@voltro/cli** — **A template could not ship a font or an image — the scaffolder corrupted every binary file.** `scaffoldFromTemplate` read each file with `readFile(src, 'utf8')` and wrote the string back. That call does not throw on binary input: it substitutes U+FFFD for every undecodable sequence and returns a string, so a woff2 went in at 15 344 bytes and came out at 27 572, silently, in every scaffolded project.
|
|
228
|
+
|
|
229
|
+
Substitution is now gated on a text-extension allowlist and everything else is copied byte-for-byte. Extension-less files and dotfiles (`Dockerfile`, `.gitignore`, `LICENSE`) count as text — they carry tokens, and treating them as binary would ship a literal `{{appName}}`.
|
|
230
|
+
|
|
231
|
+
The comment above that line already claimed "we hard-fail if a template author adds one so the failure is visible at boot". There was no such check, and there could not be one on that call. There is now: a file whose extension says text but whose bytes are not valid UTF-8 is REFUSED by name rather than written corrupt, so an allowlist that is wrong about a file fails loudly instead of quietly.
|
|
232
|
+
|
|
233
|
+
Nothing could see this. `voltro-templates`' own harness classifies files itself and copies non-text ones byte-for-byte, so `pnpm test:templates` was green over a rendering the scaffolder does not perform — it validated the harness, not the scaffold a user receives.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
42
237
|
## [0.53.0] — 2026-08-26
|
|
43
238
|
|
|
44
239
|
### ⚠ BREAKING
|
package/dist/index.js
CHANGED
|
@@ -2,21 +2,22 @@ import { Duration as e, Effect as t, Fiber as n, Schedule as r, Schema as i } fr
|
|
|
2
2
|
import { definePlugin as a, pluginInstanceName as o } from "@voltro/protocol";
|
|
3
3
|
import { and as s, count as c, eq as l, generateId as u, id as d, inSet as f, integer as p, json as m, lt as h, registerRetention as ee, retentionTtlMsFromEnv as te, table as g, text as _, timestamp as v } from "@voltro/database";
|
|
4
4
|
import { createHash as y } from "node:crypto";
|
|
5
|
+
import { withServerTracer as b } from "@voltro/runtime";
|
|
5
6
|
//#region src/errors.ts
|
|
6
|
-
var
|
|
7
|
+
var x = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {}, S = class extends i.TaggedError()("CdcDeliveryError", {
|
|
7
8
|
sink: i.String,
|
|
8
9
|
reason: i.String
|
|
9
10
|
}) {
|
|
10
11
|
get message() {
|
|
11
12
|
return `cdc-out delivery to '${this.sink}' failed: ${this.reason}`;
|
|
12
13
|
}
|
|
13
|
-
},
|
|
14
|
+
}, C = "_voltro_cdcout_outbox", w = "_voltro_cdcout_leases", T = "_voltro_cdcout_claims", E = {
|
|
14
15
|
kind: "typeid",
|
|
15
16
|
prefix: "cdcout"
|
|
16
|
-
},
|
|
17
|
+
}, D = {
|
|
17
18
|
kind: "typeid",
|
|
18
19
|
prefix: "cdcoutclaim"
|
|
19
|
-
},
|
|
20
|
+
}, O = () => u(E, C), k = () => u(D, T), A = g(C, {
|
|
20
21
|
id: d({ prefix: "cdcout" }),
|
|
21
22
|
pipe: _(),
|
|
22
23
|
sourceTable: _(),
|
|
@@ -31,19 +32,19 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
31
32
|
createdAt: v(),
|
|
32
33
|
deliveredAt: v().nullable(),
|
|
33
34
|
lastError: _().nullable()
|
|
34
|
-
}).index(["pipe", "status"]),
|
|
35
|
+
}).index(["pipe", "status"]), ne = g(T, {
|
|
35
36
|
id: d({ prefix: "cdcoutclaim" }),
|
|
36
37
|
pipe: _(),
|
|
37
38
|
changeKey: _(),
|
|
38
39
|
claimedBy: _(),
|
|
39
40
|
seenAt: v()
|
|
40
|
-
}).unique("cdcoutClaimKey", ["pipe", "changeKey"]).index(["seenAt"]), re = g(
|
|
41
|
+
}).unique("cdcoutClaimKey", ["pipe", "changeKey"]).index(["seenAt"]), re = g(w, {
|
|
41
42
|
id: d({ scheme: "numeric" }),
|
|
42
43
|
key: _(),
|
|
43
44
|
holder: _(),
|
|
44
45
|
expiresAt: v(),
|
|
45
46
|
renewedAt: v()
|
|
46
|
-
}).unique("cdcoutLeaseKey", ["key"]),
|
|
47
|
+
}).unique("cdcoutLeaseKey", ["key"]), j = (e) => e instanceof Date ? e.getTime() : new Date(String(e)).getTime(), M = class {
|
|
47
48
|
opts;
|
|
48
49
|
held = !1;
|
|
49
50
|
constructor(e) {
|
|
@@ -60,12 +61,12 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
60
61
|
};
|
|
61
62
|
try {
|
|
62
63
|
if (await e.updateMany("_voltro_cdcout_leases", n, { where: s(l("key", this.opts.key), l("holder", this.opts.holder)) }) === 1) return this.held = !0, !0;
|
|
63
|
-
let r = await e.insertIgnore(
|
|
64
|
+
let r = await e.insertIgnore(w, {
|
|
64
65
|
key: this.opts.key,
|
|
65
66
|
...n
|
|
66
67
|
}, { conflictColumns: ["key"] });
|
|
67
68
|
if (r.holder === this.opts.holder) return this.held = !0, !0;
|
|
68
|
-
let i = await e.updateMany(
|
|
69
|
+
let i = await e.updateMany(w, n, { where: s(l("key", this.opts.key), l("holder", String(r.holder)), h("expiresAt", new Date(t))) });
|
|
69
70
|
return this.held = i === 1, this.held;
|
|
70
71
|
} catch {
|
|
71
72
|
return this.held = !1, !1;
|
|
@@ -74,16 +75,16 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
74
75
|
async release(e) {
|
|
75
76
|
this.held = !1;
|
|
76
77
|
try {
|
|
77
|
-
await e.updateMany(
|
|
78
|
+
await e.updateMany(w, { expiresAt: /* @__PURE__ */ new Date(0) }, { where: s(l("key", this.opts.key), l("holder", this.opts.holder)) });
|
|
78
79
|
} catch {}
|
|
79
80
|
}
|
|
80
|
-
},
|
|
81
|
+
}, N = (e) => e == null ? "null" : e instanceof Date ? JSON.stringify(e.toISOString()) : typeof e == "bigint" ? JSON.stringify(e.toString()) : Array.isArray(e) ? `[${e.map(N).join(",")}]` : typeof e == "object" ? `{${Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t)).map(([e, t]) => `${JSON.stringify(e)}:${N(t)}`).join(",")}}` : JSON.stringify(e) ?? "null", P = (e) => y("sha256").update([
|
|
81
82
|
e.pipe,
|
|
82
83
|
e.op,
|
|
83
84
|
e.key,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
].join("\0")).digest("hex").slice(0, 32),
|
|
85
|
+
N(e.next),
|
|
86
|
+
N(e.prev)
|
|
87
|
+
].join("\0")).digest("hex").slice(0, 32), F = (e, t) => `${e}:${t}`, I = (e) => {
|
|
87
88
|
let t = e.lastIndexOf(":");
|
|
88
89
|
if (t <= 0) return null;
|
|
89
90
|
let n = Number(e.slice(t + 1));
|
|
@@ -91,7 +92,7 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
91
92
|
digest: e.slice(0, t),
|
|
92
93
|
occurrence: n
|
|
93
94
|
};
|
|
94
|
-
},
|
|
95
|
+
}, L = class {
|
|
95
96
|
#e = /* @__PURE__ */ new Map();
|
|
96
97
|
#t;
|
|
97
98
|
#n;
|
|
@@ -113,7 +114,7 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
113
114
|
}
|
|
114
115
|
seedFromChangeKeys(e, t) {
|
|
115
116
|
for (let n of e) {
|
|
116
|
-
let e =
|
|
117
|
+
let e = I(n);
|
|
117
118
|
if (e === null) continue;
|
|
118
119
|
let r = this.#e.get(e.digest), i = Math.max(r?.count ?? 0, e.occurrence + 1);
|
|
119
120
|
this.#e.set(e.digest, {
|
|
@@ -134,7 +135,7 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
134
135
|
this.#e.delete(e.value);
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
|
-
},
|
|
138
|
+
}, R = class {
|
|
138
139
|
#e = [];
|
|
139
140
|
#t = 0;
|
|
140
141
|
#n;
|
|
@@ -167,29 +168,29 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
167
168
|
for (let [e, i] of this.#e.entries()) i.observedAtMs >= t ? (e < this.#t && (r += 1), n.push(i)) : i.enqueued || (this.#i += 1);
|
|
168
169
|
this.#e = n, this.#t = r;
|
|
169
170
|
}
|
|
170
|
-
},
|
|
171
|
+
}, z = (n, r, i) => t.suspend(() => {
|
|
171
172
|
let a = new AbortController();
|
|
172
173
|
return t.try(() => n.deliver(r, { signal: a.signal })).pipe(t.flatMap((e) => t.isEffect(e) ? e : t.tryPromise(() => e))).pipe(t.timeoutFail({
|
|
173
174
|
duration: e.millis(i.timeoutMs),
|
|
174
|
-
onTimeout: () => new
|
|
175
|
+
onTimeout: () => new S({
|
|
175
176
|
sink: n.name,
|
|
176
177
|
reason: `delivery timed out after ${i.timeoutMs}ms`
|
|
177
178
|
})
|
|
178
|
-
}), t.onError(() => t.sync(() => a.abort())), t.mapError((e) => e instanceof
|
|
179
|
+
}), t.onError(() => t.sync(() => a.abort())), t.mapError((e) => e instanceof S ? e : B(n.name, e)), t.withSpan("cdcOut.deliver", { attributes: {
|
|
179
180
|
pipe: i.pipe,
|
|
180
181
|
sink: n.name,
|
|
181
182
|
records: r.length
|
|
182
183
|
} }));
|
|
183
|
-
}),
|
|
184
|
+
}), B = (e, t) => {
|
|
184
185
|
let n = typeof t == "object" && t && "error" in t ? t.error : t;
|
|
185
|
-
return new
|
|
186
|
+
return new S({
|
|
186
187
|
sink: e,
|
|
187
188
|
reason: n instanceof Error ? n.message : String(n)
|
|
188
189
|
});
|
|
189
|
-
},
|
|
190
|
+
}, V = (e, t) => {
|
|
190
191
|
let n = Math.min(t.baseMs * 2 ** Math.max(0, e - 1), t.maxMs);
|
|
191
192
|
return Math.round(n * (.5 + .5 * (t.random ?? Math.random)()));
|
|
192
|
-
},
|
|
193
|
+
}, H = class {
|
|
193
194
|
opts;
|
|
194
195
|
now;
|
|
195
196
|
stuckClaimMs;
|
|
@@ -210,7 +211,7 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
210
211
|
}
|
|
211
212
|
async pipeTick(e, n) {
|
|
212
213
|
let r = this.now();
|
|
213
|
-
if (await e.updateMany(
|
|
214
|
+
if (await e.updateMany(C, {
|
|
214
215
|
status: "pending",
|
|
215
216
|
claimedBy: null,
|
|
216
217
|
claimedAt: null
|
|
@@ -223,7 +224,7 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
223
224
|
projection: ["id"]
|
|
224
225
|
})).length > 0) return;
|
|
225
226
|
let i = await e.query({
|
|
226
|
-
table:
|
|
227
|
+
table: C,
|
|
227
228
|
predicate: s(l("pipe", n.key), l("status", "pending")),
|
|
228
229
|
order: [{
|
|
229
230
|
column: "id",
|
|
@@ -236,7 +237,7 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
236
237
|
if (i.length === 0) return;
|
|
237
238
|
let a = [];
|
|
238
239
|
for (let e of i) {
|
|
239
|
-
if (
|
|
240
|
+
if (j(e.nextAttemptAt) > r) break;
|
|
240
241
|
a.push(e);
|
|
241
242
|
}
|
|
242
243
|
if (a.length === 0) return;
|
|
@@ -247,7 +248,7 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
247
248
|
claimedAt: new Date(r)
|
|
248
249
|
}, { where: s(l("pipe", n.key), f("id", o), l("status", "pending")) }) === 0) return;
|
|
249
250
|
let c = await e.query({
|
|
250
|
-
table:
|
|
251
|
+
table: C,
|
|
251
252
|
predicate: s(l("pipe", n.key), f("id", o), l("status", "delivering"), l("claimedBy", this.opts.replicaId)),
|
|
252
253
|
order: [{
|
|
253
254
|
column: "id",
|
|
@@ -264,12 +265,12 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
264
265
|
key: e.key,
|
|
265
266
|
data: e.payload,
|
|
266
267
|
deliveryKey: e.id
|
|
267
|
-
})), d = await t.runPromise(t.either(
|
|
268
|
+
})), d = await t.runPromise(b(t.either(z(n.sink, u, {
|
|
268
269
|
timeoutMs: this.opts.deliveryTimeoutMs,
|
|
269
270
|
pipe: n.key
|
|
270
|
-
}))), p = this.now();
|
|
271
|
+
})))), p = this.now();
|
|
271
272
|
if (d._tag === "Right") {
|
|
272
|
-
await e.updateMany(
|
|
273
|
+
await e.updateMany(C, {
|
|
273
274
|
status: "delivered",
|
|
274
275
|
deliveredAt: new Date(p),
|
|
275
276
|
claimedBy: null,
|
|
@@ -281,7 +282,7 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
281
282
|
let m = d.left.message;
|
|
282
283
|
for (let t of c) {
|
|
283
284
|
let r = t.attempts + 1;
|
|
284
|
-
if (r >= this.opts.maxAttempts) await e.update(
|
|
285
|
+
if (r >= this.opts.maxAttempts) await e.update(C, t.id, {
|
|
285
286
|
status: "dead",
|
|
286
287
|
attempts: r,
|
|
287
288
|
claimedBy: null,
|
|
@@ -289,12 +290,12 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
289
290
|
lastError: m
|
|
290
291
|
}), n.stats.dead += 1;
|
|
291
292
|
else {
|
|
292
|
-
let n =
|
|
293
|
+
let n = V(r, {
|
|
293
294
|
baseMs: this.opts.backoffBaseMs,
|
|
294
295
|
maxMs: this.opts.backoffMaxMs,
|
|
295
296
|
...this.opts.random === void 0 ? {} : { random: this.opts.random }
|
|
296
297
|
});
|
|
297
|
-
await e.update(
|
|
298
|
+
await e.update(C, t.id, {
|
|
298
299
|
status: "pending",
|
|
299
300
|
attempts: r,
|
|
300
301
|
nextAttemptAt: new Date(p + n),
|
|
@@ -314,7 +315,7 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
314
315
|
reason: m
|
|
315
316
|
});
|
|
316
317
|
}
|
|
317
|
-
},
|
|
318
|
+
}, U = (e = "memory") => {
|
|
318
319
|
let t = [];
|
|
319
320
|
return {
|
|
320
321
|
name: e,
|
|
@@ -328,12 +329,12 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
328
329
|
return t.flat();
|
|
329
330
|
}
|
|
330
331
|
};
|
|
331
|
-
},
|
|
332
|
+
}, W = (e, t) => {
|
|
332
333
|
let n;
|
|
333
334
|
try {
|
|
334
335
|
n = new URL(e).host;
|
|
335
336
|
} catch {
|
|
336
|
-
throw new
|
|
337
|
+
throw new x({ message: `webhookSink: invalid url '${e}'` });
|
|
337
338
|
}
|
|
338
339
|
let r = `webhook(${n})`;
|
|
339
340
|
return {
|
|
@@ -349,20 +350,20 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
349
350
|
body: JSON.stringify({ records: n }),
|
|
350
351
|
signal: i.signal
|
|
351
352
|
});
|
|
352
|
-
if (!a.ok) throw new
|
|
353
|
+
if (!a.ok) throw new S({
|
|
353
354
|
sink: r,
|
|
354
355
|
reason: `${a.status} ${a.statusText}`
|
|
355
356
|
});
|
|
356
357
|
}
|
|
357
358
|
};
|
|
358
|
-
},
|
|
359
|
-
throw new
|
|
360
|
-
},
|
|
361
|
-
(e.sinks === void 0 || e.sinks.length === 0) &&
|
|
359
|
+
}, ie = 100, ae = 5, oe = 200, se = 3e4, ce = 250, le = 1e4, ue = 15e3, de = 72, fe = 6e4, pe = 1e4, me = 1e3, G = (e) => {
|
|
360
|
+
throw new x({ message: e });
|
|
361
|
+
}, he = (e) => {
|
|
362
|
+
(e.sinks === void 0 || e.sinks.length === 0) && G("cdcOutPlugin: at least one sink config is required");
|
|
362
363
|
let t = /* @__PURE__ */ new Set();
|
|
363
364
|
e.sinks.forEach((e, n) => {
|
|
364
|
-
(typeof e.table != "string" || e.table.length === 0) &&
|
|
365
|
-
}), e.name !== void 0 && !/^[a-zA-Z0-9-]+$/.test(e.name) &&
|
|
365
|
+
(typeof e.table != "string" || e.table.length === 0) && G(`cdcOutPlugin: sinks[${n}].table is required`), e.table.startsWith("_voltro_cdcout") && G(`cdcOutPlugin: sinks[${n}].table '${e.table}' is the plugin's own delivery state — it cannot be mirrored`), t.has(e.table) && G(`cdcOutPlugin: duplicate sink config for table '${e.table}' — one sink config per table per instance; for multiple sinks on one table wire a second cdcOutPlugin({ name: '…' }) instance`), t.add(e.table), (e.sink === void 0 || typeof e.sink.deliver != "function") && G(`cdcOutPlugin: sinks[${n}] (table '${e.table}') needs a sink with a deliver(batch) function`), e.batchSize !== void 0 && e.batchSize <= 0 && G(`cdcOutPlugin: sinks[${n}] (table '${e.table}') batchSize must be > 0`);
|
|
366
|
+
}), e.name !== void 0 && !/^[a-zA-Z0-9-]+$/.test(e.name) && G(`cdcOutPlugin: name '${e.name}' must match [a-zA-Z0-9-]+ (it lands in the inspect URL)`);
|
|
366
367
|
let n = [
|
|
367
368
|
["maxAttempts", e.maxAttempts],
|
|
368
369
|
["backoffBaseMs", e.backoffBaseMs],
|
|
@@ -375,10 +376,10 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
375
376
|
["handoffBufferMs", e.handoffBufferMs],
|
|
376
377
|
["handoffBufferSize", e.handoffBufferSize]
|
|
377
378
|
];
|
|
378
|
-
for (let [e, t] of n) t !== void 0 && t < 1 &&
|
|
379
|
-
let r = e.leaseTtlMs ??
|
|
380
|
-
e.dedupWindowMs !== void 0 && e.dedupWindowMs <= r &&
|
|
381
|
-
},
|
|
379
|
+
for (let [e, t] of n) t !== void 0 && t < 1 && G(`cdcOutPlugin: ${e} must be >= 1`);
|
|
380
|
+
let r = e.leaseTtlMs ?? ue;
|
|
381
|
+
e.dedupWindowMs !== void 0 && e.dedupWindowMs <= r && G(`cdcOutPlugin: dedupWindowMs (${e.dedupWindowMs}) must exceed leaseTtlMs (${r}) — a claim that expires inside a leadership handoff lets two replicas enqueue the same change`);
|
|
382
|
+
}, ge = (e, t) => {
|
|
382
383
|
if (t.filter !== void 0 && !t.filter(e)) return null;
|
|
383
384
|
if (e.op === "delete") {
|
|
384
385
|
let t = String(e.old?.id ?? "");
|
|
@@ -398,8 +399,8 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
398
399
|
key: r,
|
|
399
400
|
data: t.map ? t.map(n) : n
|
|
400
401
|
};
|
|
401
|
-
},
|
|
402
|
-
id:
|
|
402
|
+
}, K = (e, t) => `${e}:${t.table}:${t.sink.name}`, q = (e, t, n) => ({
|
|
403
|
+
id: O(),
|
|
403
404
|
pipe: t,
|
|
404
405
|
sourceTable: e.table,
|
|
405
406
|
op: e.op,
|
|
@@ -413,30 +414,30 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
413
414
|
createdAt: new Date(n),
|
|
414
415
|
deliveredAt: null,
|
|
415
416
|
lastError: null
|
|
416
|
-
}),
|
|
417
|
-
let i =
|
|
417
|
+
}), J = async (e, t, n, r) => {
|
|
418
|
+
let i = K(r?.instanceName ?? "default", t), a = (r?.now ?? Date.now)(), o = n.flatMap((e) => {
|
|
418
419
|
let n = String(e.id ?? "");
|
|
419
|
-
return n === "" ? [] : [
|
|
420
|
+
return n === "" ? [] : [q({
|
|
420
421
|
table: t.table,
|
|
421
422
|
op: "insert",
|
|
422
423
|
key: n,
|
|
423
424
|
data: t.map ? t.map(e) : e
|
|
424
425
|
}, i, a)];
|
|
425
426
|
});
|
|
426
|
-
return o.length > 0 && await e.insertMany(
|
|
427
|
-
},
|
|
428
|
-
|
|
427
|
+
return o.length > 0 && await e.insertMany(C, o), o.length;
|
|
428
|
+
}, _e = "@voltro/plugin-cdc-out", Y = (i) => {
|
|
429
|
+
he(i);
|
|
429
430
|
let u = i.name ?? "default", d = o({
|
|
430
|
-
base:
|
|
431
|
+
base: _e,
|
|
431
432
|
alias: i.alias,
|
|
432
433
|
instance: i.name
|
|
433
|
-
}), p = `cdcout-${Math.random().toString(36).slice(2, 10)}`, m = i.maxAttempts ??
|
|
434
|
+
}), p = `cdcout-${Math.random().toString(36).slice(2, 10)}`, m = i.maxAttempts ?? ae, g = i.sweepIntervalMs ?? ce, _ = i.leaseTtlMs ?? ue, v = i.dedupWindowMs ?? Math.max(fe, 4 * _), y = i.handoffBufferMs ?? v, b = i.handoffBufferSize ?? pe, x = /* @__PURE__ */ new Map();
|
|
434
435
|
for (let e of i.sinks) x.set(e.table, {
|
|
435
436
|
config: e,
|
|
436
437
|
enginePipe: {
|
|
437
|
-
key:
|
|
438
|
+
key: K(u, e),
|
|
438
439
|
sink: e.sink,
|
|
439
|
-
batchSize: e.batchSize ??
|
|
440
|
+
batchSize: e.batchSize ?? ie,
|
|
440
441
|
busy: !1,
|
|
441
442
|
stats: {
|
|
442
443
|
delivered: 0,
|
|
@@ -446,36 +447,36 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
446
447
|
}
|
|
447
448
|
}
|
|
448
449
|
});
|
|
449
|
-
let
|
|
450
|
+
let S = new M({
|
|
450
451
|
key: u,
|
|
451
452
|
holder: p,
|
|
452
453
|
ttlMs: _
|
|
453
|
-
}),
|
|
454
|
+
}), w = new H({
|
|
454
455
|
pipes: [...x.values()].map((e) => e.enginePipe),
|
|
455
456
|
replicaId: p,
|
|
456
457
|
maxAttempts: m,
|
|
457
|
-
backoffBaseMs: i.backoffBaseMs ??
|
|
458
|
-
backoffMaxMs: i.backoffMaxMs ??
|
|
459
|
-
deliveryTimeoutMs: i.deliveryTimeoutMs ??
|
|
460
|
-
isLeader: () =>
|
|
458
|
+
backoffBaseMs: i.backoffBaseMs ?? oe,
|
|
459
|
+
backoffMaxMs: i.backoffMaxMs ?? se,
|
|
460
|
+
deliveryTimeoutMs: i.deliveryTimeoutMs ?? le,
|
|
461
|
+
isLeader: () => S.isLeader,
|
|
461
462
|
warn: (e, t) => D(e, t)
|
|
462
|
-
}), E = { current: null }, D = () => void 0,
|
|
463
|
+
}), E = { current: null }, D = () => void 0, O = 0, j, N, I = new L({
|
|
463
464
|
windowMs: 2 * v,
|
|
464
465
|
maxEntries: Math.max(b, 1e3) * 4
|
|
465
|
-
}),
|
|
466
|
+
}), z = new R({
|
|
466
467
|
windowMs: y,
|
|
467
468
|
maxEntries: b
|
|
468
|
-
}),
|
|
469
|
+
}), B = !1, V = 0, U = !1, W = null, G = 0, J = !1, Y = !1, X = [], Z = 0;
|
|
469
470
|
ee({
|
|
470
471
|
source: "plugin",
|
|
471
|
-
table:
|
|
472
|
+
table: C,
|
|
472
473
|
timeColumn: "createdAt",
|
|
473
|
-
ttlMs: i.retentionHours === void 0 ? te(process.env.CDCOUT_RETENTION_HOURS,
|
|
474
|
+
ttlMs: i.retentionHours === void 0 ? te(process.env.CDCOUT_RETENTION_HOURS, de) : i.retentionHours * 36e5,
|
|
474
475
|
where: f("status", ["delivered", "dead"]),
|
|
475
476
|
label: "cdc-out outbox (delivered/dead)"
|
|
476
477
|
}), ee({
|
|
477
478
|
source: "plugin",
|
|
478
|
-
table:
|
|
479
|
+
table: T,
|
|
479
480
|
timeColumn: "seenAt",
|
|
480
481
|
ttlMs: v,
|
|
481
482
|
label: "cdc-out enqueue claims (dedup window)"
|
|
@@ -501,7 +502,7 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
501
502
|
};
|
|
502
503
|
return await Promise.all(be.map(async (r) => {
|
|
503
504
|
let i = await e.query({
|
|
504
|
-
table:
|
|
505
|
+
table: C,
|
|
505
506
|
predicate: s(l("pipe", t), l("status", r)),
|
|
506
507
|
order: [],
|
|
507
508
|
take: void 0,
|
|
@@ -513,53 +514,53 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
513
514
|
})), n;
|
|
514
515
|
}, Se = (e) => {
|
|
515
516
|
let t = Date.now();
|
|
516
|
-
t -
|
|
517
|
-
}, Ce = async (e, t, n) => (await e.insertIgnore(
|
|
518
|
-
id:
|
|
517
|
+
t - O > 6e4 && (O = t, D("cdc-out: no DataStore bound — change events are NOT being mirrored", { table: e }));
|
|
518
|
+
}, Ce = async (e, t, n) => (await e.insertIgnore(T, {
|
|
519
|
+
id: k(),
|
|
519
520
|
pipe: t,
|
|
520
521
|
changeKey: n,
|
|
521
522
|
claimedBy: p,
|
|
522
523
|
seenAt: /* @__PURE__ */ new Date()
|
|
523
524
|
}, { conflictColumns: ["pipe", "changeKey"] })).claimedBy === p, Q = async () => {
|
|
524
|
-
if (
|
|
525
|
+
if (B) return;
|
|
525
526
|
let e = E.current;
|
|
526
527
|
if (e !== null) {
|
|
527
|
-
|
|
528
|
+
B = !0;
|
|
528
529
|
try {
|
|
529
530
|
for (;;) {
|
|
530
|
-
let t =
|
|
531
|
-
if (t === void 0 || !
|
|
532
|
-
await Ce(e, t.pipe, t.changeKey) && await e.insert(
|
|
531
|
+
let t = z.nextPending();
|
|
532
|
+
if (t === void 0 || !S.isLeader) return;
|
|
533
|
+
await Ce(e, t.pipe, t.changeKey) && await e.insert(C, q(t.change, t.pipe, Date.now())), t.enqueued = !0;
|
|
533
534
|
}
|
|
534
535
|
} finally {
|
|
535
|
-
|
|
536
|
+
B = !1;
|
|
536
537
|
}
|
|
537
538
|
}
|
|
538
539
|
}, we = (e) => {
|
|
539
|
-
if (
|
|
540
|
+
if (J = !0, !U) {
|
|
540
541
|
for (X.push(e); X.length > b;) X.shift(), Z += 1;
|
|
541
542
|
return;
|
|
542
543
|
}
|
|
543
|
-
|
|
544
|
+
z.append({
|
|
544
545
|
pipe: e.pipe,
|
|
545
|
-
changeKey:
|
|
546
|
+
changeKey: F(e.digest, I.next(e.digest, e.observedAtMs)),
|
|
546
547
|
change: e.change,
|
|
547
548
|
observedAtMs: e.observedAtMs,
|
|
548
549
|
enqueued: !1
|
|
549
550
|
});
|
|
550
551
|
}, Te = (e, t) => {
|
|
551
|
-
I.seedFromChangeKeys(e, t),
|
|
552
|
+
I.seedFromChangeKeys(e, t), U = !0;
|
|
552
553
|
for (let e of X.splice(0, X.length)) we(e);
|
|
553
554
|
}, $ = async () => {
|
|
554
|
-
if (
|
|
555
|
+
if (U) return;
|
|
555
556
|
let e = E.current;
|
|
556
557
|
if (e !== null) {
|
|
557
|
-
if (
|
|
558
|
-
if (
|
|
559
|
-
let t = !
|
|
560
|
-
|
|
558
|
+
if (W === null) {
|
|
559
|
+
if (G !== 0 && Date.now() - G < me) return;
|
|
560
|
+
let t = !J;
|
|
561
|
+
W = (async () => {
|
|
561
562
|
let n = await e.query({
|
|
562
|
-
table:
|
|
563
|
+
table: T,
|
|
563
564
|
predicate: void 0,
|
|
564
565
|
order: [{
|
|
565
566
|
column: "seenAt",
|
|
@@ -569,24 +570,24 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
569
570
|
skip: void 0,
|
|
570
571
|
projection: ["changeKey"]
|
|
571
572
|
});
|
|
572
|
-
!t && !
|
|
573
|
+
!t && !Y && (Y = !0, D("cdc-out: occurrence counters start from this replica's own stream — the claims snapshot was only reachable after it began observing, and counting it could duplicate a change", { replicaId: p })), Te(t ? n.flatMap((e) => typeof e.changeKey == "string" ? [e.changeKey] : []) : [], Date.now());
|
|
573
574
|
})().catch((e) => {
|
|
574
|
-
|
|
575
|
+
G = Date.now(), D("cdc-out: could not seed change-occurrence counters — enqueue is held until it lands", { reason: String(e) });
|
|
575
576
|
}).finally(() => {
|
|
576
|
-
|
|
577
|
+
W = null;
|
|
577
578
|
});
|
|
578
579
|
}
|
|
579
|
-
await
|
|
580
|
+
await W;
|
|
580
581
|
}
|
|
581
582
|
}, Ee = (e) => {
|
|
582
583
|
let t = e - y;
|
|
583
584
|
for (; X.length > 0 && X[0].observedAtMs < t;) X.shift(), Z += 1;
|
|
584
585
|
}, De = async (e, t) => {
|
|
585
|
-
t -
|
|
586
|
+
t - V < Math.max(1e3, Math.floor(v / 4)) || (V = t, await e.deleteMany(T, { where: h("seenAt", new Date(t - v)) }));
|
|
586
587
|
};
|
|
587
588
|
return a({
|
|
588
589
|
name: d,
|
|
589
|
-
baseName:
|
|
590
|
+
baseName: _e,
|
|
590
591
|
description: "Declarative reverse-ETL: mirror table changes outward to external sinks (webhook, Kafka via @voltro/plugin-queue's kafkaSink, plus a CdcSink interface for custom sinks) through a durable outbox — ordered per pipe, at-least-once from enqueue, retried with backoff, dead-lettered.",
|
|
591
592
|
permissions: ye,
|
|
592
593
|
declaredEnv: [{
|
|
@@ -597,9 +598,9 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
597
598
|
example: "72"
|
|
598
599
|
}],
|
|
599
600
|
extendSchema: { tables: [
|
|
600
|
-
|
|
601
|
+
A,
|
|
601
602
|
re,
|
|
602
|
-
|
|
603
|
+
ne
|
|
603
604
|
] },
|
|
604
605
|
bindDataStore: (e) => {
|
|
605
606
|
E.current = e, $();
|
|
@@ -630,12 +631,12 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
630
631
|
};
|
|
631
632
|
})),
|
|
632
633
|
handoff: {
|
|
633
|
-
leader:
|
|
634
|
-
seeded:
|
|
634
|
+
leader: S.isLeader,
|
|
635
|
+
seeded: U,
|
|
635
636
|
awaitingSeed: X.length,
|
|
636
|
-
buffered:
|
|
637
|
-
pending:
|
|
638
|
-
dropped:
|
|
637
|
+
buffered: z.size,
|
|
638
|
+
pending: z.pendingCount(),
|
|
639
|
+
dropped: z.droppedPending + Z,
|
|
639
640
|
windowMs: y,
|
|
640
641
|
dedupWindowMs: v
|
|
641
642
|
}
|
|
@@ -654,7 +655,7 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
654
655
|
} : {
|
|
655
656
|
kind: "json",
|
|
656
657
|
data: { rows: (await e.query({
|
|
657
|
-
table:
|
|
658
|
+
table: C,
|
|
658
659
|
predicate: l("status", "dead"),
|
|
659
660
|
order: [{
|
|
660
661
|
column: "id",
|
|
@@ -679,10 +680,10 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
679
680
|
onChangeEvent: (e) => {
|
|
680
681
|
let n = x.get(e.table);
|
|
681
682
|
if (n === void 0) return t.void;
|
|
682
|
-
let r =
|
|
683
|
+
let r = ge(e, n.config);
|
|
683
684
|
if (r === null) return t.void;
|
|
684
685
|
if (e.changeScope === "fleet") {
|
|
685
|
-
let i = Date.now(), a =
|
|
686
|
+
let i = Date.now(), a = P({
|
|
686
687
|
pipe: n.enginePipe.key,
|
|
687
688
|
op: r.op,
|
|
688
689
|
key: r.key,
|
|
@@ -694,13 +695,13 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
694
695
|
digest: a,
|
|
695
696
|
change: r,
|
|
696
697
|
observedAtMs: i
|
|
697
|
-
}), E.current === null ? (Se(e.table), t.void) : t.promise(() => $()).pipe(t.flatMap(() =>
|
|
698
|
+
}), E.current === null ? (Se(e.table), t.void) : t.promise(() => $()).pipe(t.flatMap(() => S.isLeader ? t.tryPromise(() => Q()) : t.void));
|
|
698
699
|
}
|
|
699
700
|
if (e.origin === "injected") return t.void;
|
|
700
701
|
let i = E.current;
|
|
701
702
|
if (i === null) return Se(e.table), t.void;
|
|
702
|
-
let a =
|
|
703
|
-
return t.tryPromise(() => i.insert(
|
|
703
|
+
let a = q(r, n.enginePipe.key, Date.now());
|
|
704
|
+
return t.tryPromise(() => i.insert(C, a).then(() => void 0));
|
|
704
705
|
},
|
|
705
706
|
onActivate: (n) => t.sync(() => {
|
|
706
707
|
D = (e, t) => n.logger.warn(e, t);
|
|
@@ -708,8 +709,8 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
708
709
|
let e = E.current;
|
|
709
710
|
return e === null ? t.void : t.promise(async () => {
|
|
710
711
|
await $();
|
|
711
|
-
let t =
|
|
712
|
-
await
|
|
712
|
+
let t = S.isLeader;
|
|
713
|
+
await S.heartbeat(e) && !t && await Q().catch((e) => {
|
|
713
714
|
D("cdc-out: handoff drain failed (retried on the next sweep)", { reason: String(e) });
|
|
714
715
|
});
|
|
715
716
|
});
|
|
@@ -717,21 +718,21 @@ var b = class extends i.TaggedError()("CdcConfigError", { message: i.String }) {
|
|
|
717
718
|
let e = E.current;
|
|
718
719
|
return e === null ? t.void : t.tryPromise(async () => {
|
|
719
720
|
let t = Date.now();
|
|
720
|
-
await $(), Ee(t),
|
|
721
|
+
await $(), Ee(t), z.prune(t), I.prune(t), await De(e, t), S.isLeader && await Q(), await w.tick(e);
|
|
721
722
|
}).pipe(t.catchAll((e) => t.sync(() => D("cdc-out worker sweep failed", { reason: String(e) }))));
|
|
722
723
|
}).pipe(t.repeat(r.spaced(e.millis(g))));
|
|
723
|
-
|
|
724
|
+
N = t.runFork(i), j = t.runFork(a), n.logger.info("cdc-out active", {
|
|
724
725
|
tables: [...x.keys()],
|
|
725
726
|
replicaId: p,
|
|
726
|
-
outbox:
|
|
727
|
+
outbox: C
|
|
727
728
|
});
|
|
728
729
|
}),
|
|
729
730
|
onDeactivate: () => t.gen(function* () {
|
|
730
|
-
|
|
731
|
+
j !== void 0 && (yield* n.interrupt(j)), N !== void 0 && (yield* n.interrupt(N)), j = void 0, N = void 0;
|
|
731
732
|
let e = E.current;
|
|
732
|
-
e !== null && (yield* t.promise(() =>
|
|
733
|
+
e !== null && (yield* t.promise(() => S.release(e)));
|
|
733
734
|
})
|
|
734
735
|
});
|
|
735
736
|
};
|
|
736
737
|
//#endregion
|
|
737
|
-
export {
|
|
738
|
+
export { T as CDCOUT_CLAIMS_TABLE, w as CDCOUT_LEASES_TABLE, C as CDCOUT_OUTBOX_TABLE, x as CdcConfigError, S as CdcDeliveryError, M as CdcLeaseManager, H as CdcOutEngine, R as HandoffBuffer, L as OccurrenceCounter, N as canonicalJson, ne as cdcOutClaimsTable, re as cdcOutLeasesTable, A as cdcOutOutboxTable, Y as cdcOutPlugin, P as changeDigest, F as composeChangeKey, z as deliverOnce, J as enqueueBackfill, ge as mapChange, U as memorySink, k as nextClaimId, O as nextOutboxId, q as outboxRowFor, I as parseChangeKey, K as pipeKey, V as retryDelayMs, he as validateCdcOutConfig, W as webhookSink };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/plugin-cdc-out",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "Declarative reverse-ETL: mirror framework table changes outward to external sinks (webhook, Kafka via @voltro/plugin-queue's kafkaSink, plus a CdcSink interface for custom sinks) through a durable outbox — ordered per pipe, at-least-once from enqueue, retried with backoff, dead-lettered.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"node": ">=24.0.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@voltro/database": "0.
|
|
37
|
-
"@voltro/protocol": "0.
|
|
36
|
+
"@voltro/database": "0.54.0",
|
|
37
|
+
"@voltro/protocol": "0.54.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"effect": "^3.22.0"
|