@lunora/do 1.0.0-alpha.284 → 1.0.0-alpha.286

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/README.md CHANGED
@@ -87,7 +87,15 @@ instead, and so does every non-JS SDK — their `subscribe` methods do not expos
87
87
  the field at all. So no client shipped here reaches a delta stamped with a real
88
88
  table name; addressing one means building the subscribe frame by hand. Projects
89
89
  generated by `lunora codegen` route this hook to `recordChangedTable` and get
90
- server-side re-execution instead, which is the path to prefer.
90
+ server-side re-execution instead, which is the path to prefer. A subscription the shard
91
+ serves by re-execution never receives a broadcast (the shard logs a one-time warning if one
92
+ matched). On a shard that overrides `executeSubscription`, that is every function-path
93
+ subscription except one whose seed returned `null`; the choice is made per subscription, kept in
94
+ the socket attachment, and fails closed while the seed is in flight. Refuse a subscriber by
95
+ throwing, never by returning `null`, which opts it into the raw rows described next.
96
+ The broadcast row is the written row: it is not filtered by row-level security, column masks
97
+ or the subscriber's query, so filter in `matchesSubscription` or do not broadcast data an
98
+ anonymous socket may not see.
91
99
 
92
100
  > This README covers the basics. For the full API, options, and guides, see the **[documentation](https://lunora.sh/docs/api/do)**.
93
101
 
package/dist/index.d.mts CHANGED
@@ -5859,6 +5859,13 @@ declare abstract class ShardDO {
5859
5859
  private recordSubscriptionRefreshError;
5860
5860
  /** The caller identity a failing subscription is latched under; `""` (matching nothing) when the socket has no failure streak to look up. */
5861
5861
  private failureIdentityKey;
5862
+ /** A same-args re-subscribe is the client's retry at the hint and keeps the streak; new args start afresh. */
5863
+ private restartFailureStreakUnlessRetry;
5864
+ /**
5865
+ * A failure no retry can change: an access denial (revoked), a result past the size cap, and on a guarded socket a
5866
+ * persist failure. A subscription hitting one ends rather than latching for backoff.
5867
+ */
5868
+ private isDeterministicSubscriptionFailure;
5862
5869
  /**
5863
5870
  * A subscription's refresh threw: count and log it, latch it for backoff, and
5864
5871
  * tell the client the first time of a streak. The subscription stays
@@ -5876,6 +5883,8 @@ declare abstract class ShardDO {
5876
5883
  * subscriber advances to.
5877
5884
  */
5878
5885
  private refreshSubscriptions;
5886
+ /** A retried seed that failed again: the subscription stays registered and is answered with the next hint. */
5887
+ private retryFailedSeed;
5879
5888
  /**
5880
5889
  * Run {@link ShardDO.seedSubscription} and fail the ONE subscription — never
5881
5890
  * the socket — when its handler throws.
@@ -5891,7 +5900,10 @@ declare abstract class ShardDO {
5891
5900
  * spins at the initial delay for the life of the page.
5892
5901
  *
5893
5902
  * So: drop the just-registered subscription from the attachment and answer
5894
- * with a structured `error` frame carrying the thrown error's code. Mirrors
5903
+ * with a structured `error` frame carrying the thrown error's code. The one
5904
+ * exception is a retry on an unguarded socket: a same-args re-subscribe of an
5905
+ * already-registered subscription stays registered and is answered with the
5906
+ * next retry hint (see {@link ShardDO.retryFailedSeed}). Mirrors
5895
5907
  * `refreshSubscriptions`' per-`(socket, sub)` catch on the write-flush half
5896
5908
  * of the same path, and `handleShapeSubscribe`'s rollback-then-error on a
5897
5909
  * failed shape seed.
package/dist/index.d.ts CHANGED
@@ -5859,6 +5859,13 @@ declare abstract class ShardDO {
5859
5859
  private recordSubscriptionRefreshError;
5860
5860
  /** The caller identity a failing subscription is latched under; `""` (matching nothing) when the socket has no failure streak to look up. */
5861
5861
  private failureIdentityKey;
5862
+ /** A same-args re-subscribe is the client's retry at the hint and keeps the streak; new args start afresh. */
5863
+ private restartFailureStreakUnlessRetry;
5864
+ /**
5865
+ * A failure no retry can change: an access denial (revoked), a result past the size cap, and on a guarded socket a
5866
+ * persist failure. A subscription hitting one ends rather than latching for backoff.
5867
+ */
5868
+ private isDeterministicSubscriptionFailure;
5862
5869
  /**
5863
5870
  * A subscription's refresh threw: count and log it, latch it for backoff, and
5864
5871
  * tell the client the first time of a streak. The subscription stays
@@ -5876,6 +5883,8 @@ declare abstract class ShardDO {
5876
5883
  * subscriber advances to.
5877
5884
  */
5878
5885
  private refreshSubscriptions;
5886
+ /** A retried seed that failed again: the subscription stays registered and is answered with the next hint. */
5887
+ private retryFailedSeed;
5879
5888
  /**
5880
5889
  * Run {@link ShardDO.seedSubscription} and fail the ONE subscription — never
5881
5890
  * the socket — when its handler throws.
@@ -5891,7 +5900,10 @@ declare abstract class ShardDO {
5891
5900
  * spins at the initial delay for the life of the page.
5892
5901
  *
5893
5902
  * So: drop the just-registered subscription from the attachment and answer
5894
- * with a structured `error` frame carrying the thrown error's code. Mirrors
5903
+ * with a structured `error` frame carrying the thrown error's code. The one
5904
+ * exception is a retry on an unguarded socket: a same-args re-subscribe of an
5905
+ * already-registered subscription stays registered and is answered with the
5906
+ * next retry hint (see {@link ShardDO.retryFailedSeed}). Mirrors
5895
5907
  * `refreshSubscriptions`' per-`(socket, sub)` catch on the write-flush half
5896
5908
  * of the same path, and `handleShapeSubscribe`'s rollback-then-error on a
5897
5909
  * failed shape seed.
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{AdminRevocationDO as a}from"./packem_shared/AdminRevocationDO-DHjoZWfF.mjs";import{installDeliveryFence as t}from"./packem_shared/installDeliveryFence-B6M9KOnb.mjs";import{MERGED_ROLES as S,mergeDurableObjects as i,roleNamespace as l}from"./packem_shared/MERGED_ROLES-BAMAmIcW.mjs";import{serveRelationFanout as n}from"./packem_shared/serveRelationFanout-DcSjzAZv.mjs";import{SESSION_DO_TTL_DEFAULT as d,SessionDO as p}from"./packem_shared/SESSION_DO_TTL_DEFAULT-DSvTwRjc.mjs";import{ROOT_DO_SIZE_WARN_BYTES as D,ROOT_SHARD_NAME as O,ShardDO as E}from"./packem_shared/ROOT_DO_SIZE_WARN_BYTES-Bd7BVyHr.mjs";import{SHARD_REGISTRY_DO_NAME as h,ShardRegistryDO as x,hostedShardRegistry as f}from"./packem_shared/SHARD_REGISTRY_DO_NAME-Dbh8JQJQ.mjs";import{createStableIdFactory as A,createStableRandomFactory as I}from"./packem_shared/createStableIdFactory-DPDT_chw.mjs";import{createShardAlarms as b,createShardDirectory as M,createShardHost as N,createShardKvStore as g,createShardPlatform as y,createSocketHost as k,createWorkerPlatform as F}from"@lunora/platform-cloudflare";import{REPROJECTION_MIGRATION_PREFIX as L,UNVOUCHABLE_DEP as v,applyCdcChanges as H,assertShapeShardable as P,backfillSearchIndexes as j,backfillVectorIndexes as U,buildReprojectionMigration as w,clearMemoryTables as G,countLegacyRows as V,createReadFootprint as B,createShardCtxDb as W,exportShardRows as Y,importShardRows as J,isSourceDue as K,markUnvouchableReads as X,pullExternalSourceIncrementalTick as Z,pullExternalSourceTick as q,reprojectionMigrationId as z,reprojectionTables as Q,runDataMigration as $,runShardMigrations as ee,subscriptionListDeltas as re}from"@lunora/shard-engine";import{A as oe}from"./packem_shared/admin-token-DrufJIZV.mjs";export{oe as ADMIN_REVOCATION_DO_NAME,a as AdminRevocationDO,S as MERGED_ROLES,L as REPROJECTION_MIGRATION_PREFIX,D as ROOT_DO_SIZE_WARN_BYTES,O as ROOT_SHARD_NAME,d as SESSION_DO_TTL_DEFAULT,h as SHARD_REGISTRY_DO_NAME,p as SessionDO,E as ShardDO,x as ShardRegistryDO,v as UNVOUCHABLE_DEP,H as applyCdcChanges,P as assertShapeShardable,j as backfillSearchIndexes,U as backfillVectorIndexes,w as buildReprojectionMigration,G as clearMemoryTables,V as countLegacyRows,B as createReadFootprint,b as createShardAlarms,W as createShardCtxDb,M as createShardDirectory,N as createShardHost,g as createShardKvStore,y as createShardPlatform,k as createSocketHost,A as createStableIdFactory,I as createStableRandomFactory,F as createWorkerPlatform,Y as exportShardRows,f as hostedShardRegistry,J as importShardRows,t as installDeliveryFence,K as isSourceDue,X as markUnvouchableReads,i as mergeDurableObjects,Z as pullExternalSourceIncrementalTick,q as pullExternalSourceTick,z as reprojectionMigrationId,Q as reprojectionTables,l as roleNamespace,$ as runDataMigration,ee as runShardMigrations,n as serveRelationFanout,re as subscriptionListDeltas};
1
+ import{AdminRevocationDO as a}from"./packem_shared/AdminRevocationDO-DHjoZWfF.mjs";import{installDeliveryFence as t}from"./packem_shared/installDeliveryFence-B6M9KOnb.mjs";import{MERGED_ROLES as S,mergeDurableObjects as i,roleNamespace as l}from"./packem_shared/MERGED_ROLES-BAMAmIcW.mjs";import{serveRelationFanout as n}from"./packem_shared/serveRelationFanout-DcSjzAZv.mjs";import{SESSION_DO_TTL_DEFAULT as d,SessionDO as p}from"./packem_shared/SESSION_DO_TTL_DEFAULT-DSvTwRjc.mjs";import{ROOT_DO_SIZE_WARN_BYTES as D,ROOT_SHARD_NAME as O,ShardDO as E}from"./packem_shared/ROOT_DO_SIZE_WARN_BYTES-vdebJc1d.mjs";import{SHARD_REGISTRY_DO_NAME as h,ShardRegistryDO as x,hostedShardRegistry as f}from"./packem_shared/SHARD_REGISTRY_DO_NAME-Dbh8JQJQ.mjs";import{createStableIdFactory as A,createStableRandomFactory as I}from"./packem_shared/createStableIdFactory-DPDT_chw.mjs";import{createShardAlarms as b,createShardDirectory as M,createShardHost as N,createShardKvStore as g,createShardPlatform as y,createSocketHost as k,createWorkerPlatform as F}from"@lunora/platform-cloudflare";import{REPROJECTION_MIGRATION_PREFIX as L,UNVOUCHABLE_DEP as v,applyCdcChanges as H,assertShapeShardable as P,backfillSearchIndexes as j,backfillVectorIndexes as U,buildReprojectionMigration as w,clearMemoryTables as G,countLegacyRows as V,createReadFootprint as B,createShardCtxDb as W,exportShardRows as Y,importShardRows as J,isSourceDue as K,markUnvouchableReads as X,pullExternalSourceIncrementalTick as Z,pullExternalSourceTick as q,reprojectionMigrationId as z,reprojectionTables as Q,runDataMigration as $,runShardMigrations as ee,subscriptionListDeltas as re}from"@lunora/shard-engine";import{A as oe}from"./packem_shared/admin-token-DrufJIZV.mjs";export{oe as ADMIN_REVOCATION_DO_NAME,a as AdminRevocationDO,S as MERGED_ROLES,L as REPROJECTION_MIGRATION_PREFIX,D as ROOT_DO_SIZE_WARN_BYTES,O as ROOT_SHARD_NAME,d as SESSION_DO_TTL_DEFAULT,h as SHARD_REGISTRY_DO_NAME,p as SessionDO,E as ShardDO,x as ShardRegistryDO,v as UNVOUCHABLE_DEP,H as applyCdcChanges,P as assertShapeShardable,j as backfillSearchIndexes,U as backfillVectorIndexes,w as buildReprojectionMigration,G as clearMemoryTables,V as countLegacyRows,B as createReadFootprint,b as createShardAlarms,W as createShardCtxDb,M as createShardDirectory,N as createShardHost,g as createShardKvStore,y as createShardPlatform,k as createSocketHost,A as createStableIdFactory,I as createStableRandomFactory,F as createWorkerPlatform,Y as exportShardRows,f as hostedShardRegistry,J as importShardRows,t as installDeliveryFence,K as isSourceDue,X as markUnvouchableReads,i as mergeDurableObjects,Z as pullExternalSourceIncrementalTick,q as pullExternalSourceTick,z as reprojectionMigrationId,Q as reprojectionTables,l as roleNamespace,$ as runDataMigration,ee as runShardMigrations,n as serveRelationFanout,re as subscriptionListDeltas};