@voltro/client 0.62.1 → 0.62.3

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 CHANGED
@@ -39,6 +39,35 @@ _Changes staged for the next release accumulate here (rolled up from
39
39
 
40
40
  ---
41
41
 
42
+ ## [0.62.3] — 2026-09-03
43
+
44
+ ### Added
45
+
46
+ - **@voltro/runtime** — `EffectStore` now exposes the complete Promise-store mutation surface plus transactions that roll back while preserving an inner Effect Cause. `defineSubscriber` accepts `eachReplica: true` so local per-replica work can state its topology explicitly; it cannot be combined with `once`.
47
+
48
+ ### Fixed
49
+
50
+ - **@voltro/cli** — `voltro build` no longer starts Vite's HMR WebSocket while pre-rendering. A `RedirectError` from a static loader is now emitted as redirect metadata and served by `voltro start` with its exact status and `Location`; unrelated loader errors still fail the build.
51
+ - **@voltro/cli, @voltro/database, @voltro/plugin-storage** — `voltro doctor` now resolves grouped event bindings and narrows its hand-roll, junction, ownership, nullable-write, singleton-read, and UI reachability checks to evidence they can actually prove. Ids owned by external systems can be declared with `.externalId()`; plugin references and non-FK asset references carry that metadata automatically.
52
+
53
+ ---
54
+
55
+ ## [0.62.2] — 2026-09-03
56
+
57
+ ### Added
58
+
59
+ - **@voltro/client, @voltro/web, @voltro/runtime, @voltro/cli, @voltro/devtools, @voltro/workflow** — Reconnect incidents now have one bounded, payload-free evidence path: browser diagnostics retain runtime/socket/protocol/subscription transitions across a reload, the subscriptions panel exposes recovery progress and stuck re-issues, and `voltro support collect` joins that export to inspect snapshots and exact browser-to-replica socket ids. The opt-in browser fault harness can reproduce a bounded transport cut without a proxy; logs and traces remain excluded from the support bundle unless explicitly requested.
60
+
61
+ Workflow admission rows now retain queue-time app/schema provenance. `voltro workflows flow validate` checks queued payloads against the current release without returning them, while `flow retry <intentId>` re-arms one retained dead letter after its fix. Support bundles also inventory project `conflictColumns` callsites, and `voltro support sentry <eventId>` delegates source-map resolution diagnosis to Sentry's own CLI.
62
+ - **@voltro/runtime** — Successful rpc WebSocket upgrades now emit structured open and close records carrying the serving `replicaId` and a stable per-socket `connectionId`, so connection cuts can be correlated to an api replica without debug traffic.
63
+
64
+ ### Fixed
65
+
66
+ - **@voltro/client, @voltro/web, @voltro/react-native** — Subscription recovery now re-issues transport-failed active subscriptions only after the rpc protocol has cleared the previous socket error. A longer outage could previously reopen the WebSocket, immediately reject every re-issued subscription against the stale error, and leave the screen degraded until a reload.
67
+ - **@voltro/workflow, @voltro/cli, @voltro/devtools-ui** — Queued workflow starts whose stored payload no longer decodes now signal `onFailure` once and remain visible as dead-letter intents instead of retrying forever. Inspect or remove them with `voltro workflows flow` and `voltro workflows flow discard <intentId>`; a valid later debounce arrival for the same key replaces the obsolete payload and resumes normal draining.
68
+
69
+ ---
70
+
42
71
  ## [0.62.1] — 2026-09-02
43
72
 
44
73
  ### Fixed
@@ -46,6 +75,11 @@ _Changes staged for the next release accumulate here (rolled up from
46
75
  - **@voltro/client, @voltro/web, @voltro/react-native** — `useSubscriptionHealth` now clears failures when replacement subscriptions succeed after a reconnect; each api keeps one error bus across transport, auth-refresh, and subject-reconnect generations.
47
76
  - **@voltro/client, @voltro/web, @voltro/react-native** — Active subscriptions whose fibers ended in a transport failure are now re-issued when the rpc socket opens again, preserving their last rows and resume revision; `useConnectionStatus` stays degraded until every affected subscription delivers a later snapshot or delta.
48
77
 
78
+ **Correction:** In 0.62.1 that reissue runs on the raw WebSocket `open`, before
79
+ the rpc protocol clears the previous socket error. After a longer outage the
80
+ reissued fibers can therefore fail immediately and remain terminal. The next
81
+ patch moves recovery behind the protocol-ready `onOpen` effect.
82
+
49
83
  ### Internal (no consumer-facing effect)
50
84
 
51
85
  - **@voltro/local-first** — Release dependency floors now exclude the vulnerable `fast-uri` and `@xmldom/xmldom` ranges, and the local-first test toolchain uses the patched Tiptap release.
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ import { RpcClient } from '@effect/rpc';
14
14
  import { RpcClientError } from '@effect/rpc';
15
15
  import { RpcGroup } from '@effect/rpc';
16
16
  import { Schema } from 'effect';
17
+ import * as Socket from '@effect/platform/Socket';
17
18
  import { Stream } from 'effect';
18
19
  import { SubscriptionEvent } from '@voltro/protocol';
19
20
  import { TargetRelations } from '@voltro/protocol';
@@ -336,7 +337,8 @@ export declare interface AutoApplyTarget {
336
337
  *
337
338
  * Resolving this function means the rpc client exists; it does NOT prove the
338
339
  * background socket loop has opened. Active subscription fibers that fail
339
- * before a later `open` are resumed by the cache at that open boundary.
340
+ * before a later `open` are resumed by the cache after the rpc protocol has
341
+ * cleared the previous transport error and marked that socket send-capable.
340
342
  * Construction failures still reject and are left to the caller's supervisor.
341
343
  */
342
344
  export declare const buildApiRuntime: (options: BuildApiRuntimeOptions) => Promise<BuiltApiRuntime>;
@@ -344,6 +346,8 @@ export declare const buildApiRuntime: (options: BuildApiRuntimeOptions) => Promi
344
346
  export declare interface BuildApiRuntimeOptions {
345
347
  /** Stable api name — used only to tag the client's Context. */
346
348
  readonly name: string;
349
+ /** Supervisor transport generation; 0 for a standalone runtime. */
350
+ readonly generation?: number;
347
351
  /** WebSocket URL of the api (`ws(s)://host:port/ws`). */
348
352
  readonly wsUrl: string;
349
353
  /**
@@ -401,6 +405,13 @@ declare interface CacheEntry {
401
405
  /** The last fiber ended because the rpc transport failed. A later socket
402
406
  * `open` re-issues active entries with their last-known-good base intact. */
403
407
  resumeAfterTransportOpen: boolean;
408
+ recoveryPhase: 'steady' | 'awaiting-protocol' | 'awaiting-delivery' | 'stuck';
409
+ recoveryAttempt: number;
410
+ lastTransportFailureAt: number | undefined;
411
+ lastReissueAt: number | undefined;
412
+ lastDeliveryAt: number | undefined;
413
+ recoveryBasePreserved: boolean;
414
+ recoveryTimer: ReturnType<typeof setTimeout> | null;
404
415
  /** Pending eviction (last subscriber gone, TTL countdown). */
405
416
  evictionTimer: NodeJS.Timeout | null;
406
417
  /** Source table(s) this entry reads (from the rpc descriptor). Used by
@@ -448,6 +459,15 @@ export declare interface CacheEntrySnapshot {
448
459
  /** True after the last subscriber left and the eviction TTL is
449
460
  * counting down — a quick remount within the window resurrects. */
450
461
  readonly evicting: boolean;
462
+ /** Recovery of a transport-terminal stream, without exposing its input. */
463
+ readonly recovery: {
464
+ readonly phase: 'steady' | 'awaiting-protocol' | 'awaiting-delivery' | 'stuck';
465
+ readonly attempt: number;
466
+ readonly lastTransportFailureAt: number | undefined;
467
+ readonly lastReissueAt: number | undefined;
468
+ readonly lastDeliveryAt: number | undefined;
469
+ readonly basePreserved: boolean;
470
+ };
451
471
  readonly snapshot: CacheSnapshot<unknown>;
452
472
  }
453
473
 
@@ -560,6 +580,8 @@ export declare interface CapabilityTable {
560
580
  readonly editable?: boolean;
561
581
  }
562
582
 
583
+ export declare const clearClientDiagnostics: () => void;
584
+
563
585
  /** Clear the buffer (devtools "Clear" button). */
564
586
  export declare const clearMutations: () => void;
565
587
 
@@ -585,6 +607,36 @@ export declare const CLIENT_NAME: "framework-client";
585
607
  */
586
608
  export declare type ClientDescriptorMap = Readonly<Record<string, ClientDescriptor>>;
587
609
 
610
+ export declare interface ClientDiagnosticEvent {
611
+ readonly sequence: number;
612
+ readonly at: number;
613
+ readonly elapsedMs: number;
614
+ readonly api: string;
615
+ readonly kind: ClientDiagnosticKind;
616
+ readonly fields: Readonly<Record<string, ClientDiagnosticValue>>;
617
+ }
618
+
619
+ export declare type ClientDiagnosticKind = 'runtime.build-started' | 'runtime.resolved' | 'runtime.failed' | 'runtime.swapped' | 'runtime.disposed' | 'socket.created' | 'socket.raw-open' | 'socket.close' | 'socket.error' | 'socket.connect-timeout' | 'socket.retry-scheduled' | 'protocol.ready' | 'subscription.transport-failed' | 'subscription.reissue-started' | 'subscription.reissue-skipped' | 'subscription.first-delivery' | 'subscription.recovery-stuck' | 'subscription.health-cleared' | 'connection.status' | 'fault.transport-cut';
620
+
621
+ export declare interface ClientDiagnosticsSnapshot {
622
+ readonly version: 1;
623
+ readonly generatedAt: number;
624
+ readonly sessionStartedAt: number;
625
+ readonly persisted: boolean;
626
+ readonly dropped: number;
627
+ readonly events: ReadonlyArray<ClientDiagnosticEvent>;
628
+ }
629
+
630
+ export declare const clientDiagnosticsSnapshot: (api?: string) => ClientDiagnosticsSnapshot;
631
+
632
+ export declare interface ClientDiagnosticsStorage {
633
+ getItem(key: string): string | null;
634
+ setItem(key: string, value: string): void;
635
+ removeItem(key: string): void;
636
+ }
637
+
638
+ export declare type ClientDiagnosticValue = string | number | boolean | null;
639
+
588
640
  export declare interface ClientErrorEvent {
589
641
  /** The thrown value (Error | anything). */
590
642
  readonly error: unknown;
@@ -704,6 +756,8 @@ export declare interface ConnectionState {
704
756
  readonly failureCount: number;
705
757
  /** When the most recent failure was observed. */
706
758
  readonly lastFailureAt: number | undefined;
759
+ /** Subscription tags still waiting for their own post-reconnect delivery. */
760
+ readonly failedSubscriptions: ReadonlyArray<string>;
707
761
  }
708
762
 
709
763
  export declare type ConnectionStatus = 'connected' | 'degraded' | 'offline';
@@ -850,6 +904,8 @@ export declare const defineTracking: <P = Record<string, unknown>>(name: string,
850
904
  */
851
905
  export declare const deriveEntityAdmins: (manifest: CapabilityManifest) => ReadonlyArray<EntityAdminSpec>;
852
906
 
907
+ export declare const disableClientDiagnosticsPersistence: () => void;
908
+
853
909
  /** The document's locale per the framework contract (`<html lang>`); `'en'`
854
910
  * outside a browser. Primary subtag only (`de-AT` → `de`). */
855
911
  export declare const documentLocale: () => string;
@@ -857,6 +913,13 @@ export declare const documentLocale: () => string;
857
913
  /** The empty value — what an unfilled rich-text field holds. */
858
914
  export declare const emptyRichTextDocument: RichTextDocument;
859
915
 
916
+ /**
917
+ * Persist diagnostics for the current browser session. Calling this more than
918
+ * once is safe. Previously persisted events are loaded before current-memory
919
+ * events and de-duplicated by sequence.
920
+ */
921
+ export declare const enableClientDiagnosticsPersistence: (storage: ClientDiagnosticsStorage) => void;
922
+
860
923
  export declare const enqueueEntry: (queue: Outbox, id: string, tag: string, input: unknown) => Outbox;
861
924
 
862
925
  /**
@@ -1954,6 +2017,9 @@ export declare const readPreloadedSeedOutcome: (api: string, rpcTag: string, inp
1954
2017
  */
1955
2018
  export declare const readPreloadedSnapshot: (api: string, rpcTag: string, input: Readonly<Record<string, unknown>>) => unknown;
1956
2019
 
2020
+ /** Record one payload-free transition. Safe to call on every production path. */
2021
+ export declare const recordClientDiagnostic: (api: string, kind: ClientDiagnosticKind, fields?: Readonly<Record<string, ClientDiagnosticValue | undefined>>) => ClientDiagnosticEvent;
2022
+
1957
2023
  export declare interface RecordState<R> {
1958
2024
  readonly record: R | undefined;
1959
2025
  readonly loading: boolean;
@@ -3051,6 +3117,8 @@ export declare interface StoreUseOptions<T> {
3051
3117
  readonly retain?: boolean;
3052
3118
  }
3053
3119
 
3120
+ export declare const subscribeClientDiagnostics: (listener: () => void) => (() => void);
3121
+
3054
3122
  /** Subscribe to client errors. Returns an unsubscribe fn. */
3055
3123
  export declare const subscribeClientErrors: (listener: ClientErrorListener) => (() => void);
3056
3124
 
@@ -3069,7 +3137,10 @@ export declare class SubscriptionCache {
3069
3137
  private readonly errorBus;
3070
3138
  private readonly mirror;
3071
3139
  private readonly mergeCell;
3140
+ private readonly apiName;
3141
+ private readonly recoveryStuckMs;
3072
3142
  constructor(options?: SubscriptionCacheOptions);
3143
+ private diagnose;
3073
3144
  /**
3074
3145
  * Register a subscriber. The cache forks the underlying fiber on the
3075
3146
  * first subscriber and re-uses it for the rest. Returns the snapshot
@@ -3306,6 +3377,10 @@ export declare interface SubscriptionCacheOptions {
3306
3377
  * cache reports it to the bus so global listeners (e.g. auto-logout
3307
3378
  * on Unauthenticated) can react. */
3308
3379
  readonly errorBus?: RpcErrorBus;
3380
+ /** Logical api name for payload-free diagnostics. Omit for standalone caches. */
3381
+ readonly apiName?: string;
3382
+ /** Time after a transport reissue with no delivery before one stuck event. */
3383
+ readonly recoveryStuckMs?: number;
3309
3384
  }
3310
3385
 
3311
3386
  /**
@@ -4579,6 +4654,8 @@ export declare type WithOptimistic<T> = T extends ReadonlyArray<infer Element> ?
4579
4654
  readonly optimistic?: boolean;
4580
4655
  } : Element> : T;
4581
4656
 
4657
+ /* Excluded from this release type: withProtocolOpenRecovery */
4658
+
4582
4659
  export declare interface WorkflowClientMessages {
4583
4660
  readonly signals?: Readonly<Record<string, unknown>>;
4584
4661
  readonly updates?: Readonly<Record<string, {