@bounded-sh/core 0.0.108 → 0.0.110

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.
Files changed (25) hide show
  1. package/dist/{index-No5Vz0YM.mjs → index-CVWqE5hO.mjs} +23 -12
  2. package/dist/index-CVWqE5hO.mjs.map +1 -0
  3. package/dist/{index-BawH-9Rq.js → index-DOKk4VdC.js} +23 -12
  4. package/dist/index-DOKk4VdC.js.map +1 -0
  5. package/dist/index.js +1 -1
  6. package/dist/index.mjs +1 -1
  7. package/dist/{realtime-store-D_M3T5mH.js → realtime-store-CIrvP17-.js} +2 -2
  8. package/dist/{realtime-store-D_M3T5mH.js.map → realtime-store-CIrvP17-.js.map} +1 -1
  9. package/dist/{realtime-store-iXGbzhjG.mjs → realtime-store-Cno1p315.mjs} +2 -2
  10. package/dist/{realtime-store-iXGbzhjG.mjs.map → realtime-store-Cno1p315.mjs.map} +1 -1
  11. package/dist/{solana-message-DQVrh3NC.js → solana-message-BMaEWGOW.js} +2 -2
  12. package/dist/{solana-message-DQVrh3NC.js.map → solana-message-BMaEWGOW.js.map} +1 -1
  13. package/dist/{solana-message-BBKdydqt.mjs → solana-message-BTs3b7JU.mjs} +2 -2
  14. package/dist/{solana-message-BBKdydqt.mjs.map → solana-message-BTs3b7JU.mjs.map} +1 -1
  15. package/dist/{solana-operations-CIiyUG3b.js → solana-operations-BcFqY34S.js} +3 -3
  16. package/dist/{solana-operations-CIiyUG3b.js.map → solana-operations-BcFqY34S.js.map} +1 -1
  17. package/dist/{solana-operations-Dtow91W5.mjs → solana-operations-CU-8CFHk.mjs} +3 -3
  18. package/dist/{solana-operations-Dtow91W5.mjs.map → solana-operations-CU-8CFHk.mjs.map} +1 -1
  19. package/dist/{solana-v1-operations-BF5aGRmx.mjs → solana-v1-operations-BNLWUYEm.mjs} +3 -3
  20. package/dist/{solana-v1-operations-BF5aGRmx.mjs.map → solana-v1-operations-BNLWUYEm.mjs.map} +1 -1
  21. package/dist/{solana-v1-operations-DfZr0cjj.js → solana-v1-operations-RNpyoM03.js} +3 -3
  22. package/dist/{solana-v1-operations-DfZr0cjj.js.map → solana-v1-operations-RNpyoM03.js.map} +1 -1
  23. package/package.json +2 -2
  24. package/dist/index-BawH-9Rq.js.map +0 -1
  25. package/dist/index-No5Vz0YM.mjs.map +0 -1
@@ -4188,7 +4188,7 @@ class ServerSessionManager {
4188
4188
  const sessionConfig = (_a = this.sessionConfig) !== null && _a !== void 0 ? _a : undefined;
4189
4189
  /* fetch nonce from auth API (bound to the snapshotted app+issuer) */
4190
4190
  const nonce = await genAuthNonce(sessionConfig);
4191
- const { genSolanaMessage } = await import('./solana-message-BBKdydqt.mjs');
4191
+ const { genSolanaMessage } = await import('./solana-message-BTs3b7JU.mjs');
4192
4192
  const message = await genSolanaMessage(address, nonce, sessionConfig === null || sessionConfig === void 0 ? void 0 : sessionConfig.appId);
4193
4193
  /* sign the message */
4194
4194
  const sigBytes = nacl.sign.detached(new TextEncoder().encode(message), kp.secretKey);
@@ -6653,6 +6653,11 @@ function notifyCallbacks(subscription, data) {
6653
6653
  // notification don't cause callbacks to be skipped.
6654
6654
  notifyCallbackOptions(subscription.callbacks.slice(), data);
6655
6655
  }
6656
+ function isTransientAuthReconnect(error) {
6657
+ return !!error
6658
+ && typeof error === 'object'
6659
+ && error.__boundedAuthChangeTransient === true;
6660
+ }
6656
6661
  function notifyErrorCallback(callback, error) {
6657
6662
  let delivered = false;
6658
6663
  try {
@@ -7162,15 +7167,16 @@ async function subscribeV2(path, subscriptionOptions, roomRoutePath) {
7162
7167
  }
7163
7168
  catch (error) {
7164
7169
  const err = error instanceof Error ? error : new Error(String(error));
7170
+ const transient = isTransientAuthReconnect(err);
7165
7171
  let deliveredLocally = false;
7166
- if (!err.__boundedDeliveredToOnError) {
7172
+ if (!transient && !err.__boundedDeliveredToOnError) {
7167
7173
  deliveredLocally = notifyErrorCallback(subscriptionOptions, err);
7168
7174
  }
7169
- if (!subscriptionOptions.onError) {
7175
+ if (!transient && !subscriptionOptions.onError) {
7170
7176
  await removeCallbackFromSubscription(connection, existingSubscription.subscriptionId, subscriptionOptions);
7171
7177
  throw err;
7172
7178
  }
7173
- if (!err.__boundedDeliveredToOnError && !deliveredLocally) {
7179
+ if (!transient && !err.__boundedDeliveredToOnError && !deliveredLocally) {
7174
7180
  console.warn('[WS v2] Subscription refresh failed, keeping for reconnect recovery:', error);
7175
7181
  }
7176
7182
  }
@@ -7261,14 +7267,15 @@ async function subscribeV2(path, subscriptionOptions, roomRoutePath) {
7261
7267
  }
7262
7268
  catch (error) {
7263
7269
  const err = error instanceof Error ? error : new Error(String(error));
7270
+ const transient = isTransientAuthReconnect(err);
7264
7271
  let deliveredLocally = false;
7265
- if (!err.__boundedDeliveredToOnError) {
7272
+ if (!transient && !err.__boundedDeliveredToOnError) {
7266
7273
  // A local confirmation timeout belongs to the caller that
7267
7274
  // originated it. Joined callbacks may already have a viable
7268
7275
  // same-id refresh and must not be poisoned by that old attempt.
7269
7276
  deliveredLocally = notifyErrorCallback(subscriptionOptions, err);
7270
7277
  }
7271
- if (!subscriptionOptions.onError) {
7278
+ if (!transient && !subscriptionOptions.onError) {
7272
7279
  rejectPendingSubscriptionConfirmation(connection, subscriptionId, err);
7273
7280
  // This registration may have acquired joined callbacks while
7274
7281
  // its confirmation was pending. Remove only the originating
@@ -7277,7 +7284,7 @@ async function subscribeV2(path, subscriptionOptions, roomRoutePath) {
7277
7284
  await removeCallbackFromSubscription(connection, subscriptionId, subscriptionOptions);
7278
7285
  throw err;
7279
7286
  }
7280
- if (!err.__boundedDeliveredToOnError && !deliveredLocally) {
7287
+ if (!transient && !err.__boundedDeliveredToOnError && !deliveredLocally) {
7281
7288
  console.warn('[WS v2] Subscription confirmation failed, keeping for reconnect recovery:', error);
7282
7289
  }
7283
7290
  }
@@ -7467,7 +7474,7 @@ async function doReconnectWithNewAuth() {
7467
7474
  console.warn('[WS v2] Failed to clear HTTP read cache on auth change:', error);
7468
7475
  }
7469
7476
  try {
7470
- const { reconnectRealtimeStoreWithNewAuth } = await import('./realtime-store-iXGbzhjG.mjs');
7477
+ const { reconnectRealtimeStoreWithNewAuth } = await import('./realtime-store-Cno1p315.mjs');
7471
7478
  await reconnectRealtimeStoreWithNewAuth();
7472
7479
  }
7473
7480
  catch (error) {
@@ -7479,6 +7486,10 @@ async function doReconnectWithNewAuth() {
7479
7486
  }
7480
7487
  cancelIdleConnectionClose(connection);
7481
7488
  const reconnectError = new Error('Connection reconnecting due to auth change');
7489
+ // The replay on this same subscription delivers the next snapshot.
7490
+ // Surfacing the reconnect itself leaves a raw subscriber stuck on it
7491
+ // after that data has already arrived.
7492
+ reconnectError.__boundedAuthChangeTransient = true;
7482
7493
  for (const subscriptionId of Array.from(connection.pendingSubscriptions.keys())) {
7483
7494
  rejectPendingSubscriptionConfirmation(connection, subscriptionId, reconnectError);
7484
7495
  }
@@ -8961,7 +8972,7 @@ async function setMany(many, options) {
8961
8972
  if (typeof curTx.serializedTransaction !== 'string' || typeof curTx.poofnetIntentId !== 'string') {
8962
8973
  throw new Error('Unsupported 202 transaction shape: a poofnet write needs serializedTransaction and poofnetIntentId');
8963
8974
  }
8964
- const { signPoofnetTransaction, buildExpectedWriteIntent } = await import('./solana-operations-Dtow91W5.mjs');
8975
+ const { signPoofnetTransaction, buildExpectedWriteIntent } = await import('./solana-operations-CU-8CFHk.mjs');
8965
8976
  const signedTransaction = await signPoofnetTransaction(curTx.serializedTransaction, authProvider, options, buildExpectedWriteIntent(documents));
8966
8977
  // Signing-only, exactly as on a real chain: signed and NOT committed.
8967
8978
  if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
@@ -8986,7 +8997,7 @@ async function setMany(many, options) {
8986
8997
  'Nothing was signed or submitted.');
8987
8998
  }
8988
8999
  const solanaChain = workerChain;
8989
- const { handlePreBuiltTransaction, buildExpectedWriteIntent } = await import('./solana-operations-Dtow91W5.mjs');
9000
+ const { handlePreBuiltTransaction, buildExpectedWriteIntent } = await import('./solana-operations-CU-8CFHk.mjs');
8990
9001
  // OA-0001: derive the expected intent from OUR OWN request (the one
8991
9002
  // ground truth a tampered builder response cannot change) so the
8992
9003
  // validator can reject any transaction whose operation semantics
@@ -10750,7 +10761,7 @@ function toMillis(seconds) {
10750
10761
 
10751
10762
  /** SIWS message creation is async already, so its onchain module can be lazy. */
10752
10763
  async function genSolanaMessage(address, nonce) {
10753
- const implementation = await import('./solana-message-BBKdydqt.mjs');
10764
+ const implementation = await import('./solana-message-BTs3b7JU.mjs');
10754
10765
  return implementation.genSolanaMessage(address, nonce);
10755
10766
  }
10756
10767
 
@@ -11300,4 +11311,4 @@ function defineLiveModule(mod) {
11300
11311
  }
11301
11312
 
11302
11313
  export { increment as $, isWriteNotApplied as A, writeNotAppliedPhase as B, subscribe as C, closeAllSubscriptions as D, clearCache as E, getCachedData as F, reconnectWithNewAuth as G, createClient as H, InsufficientBalanceError as I, exchangeAppToken as J, clearAppTokenCache as K, createAppTokenAuthHeaders as L, AppTokenExchangeError as M, subscribeQuery as N, closeAllQuerySubscriptions as O, canonicalizeArgs as P, canonicalizeResult as Q, DEFAULT_QUERY_POLL_INTERVAL_MS as R, ScopedClientReadOnlyError as S, MIN_QUERY_POLL_INTERVAL_MS as T, BoundedDeclineError as U, deriveDecline as V, dispatchDeclineEvent as W, DECLINE_EVENT_NAME as X, dispatchRateLimitEvent as Y, RATE_LIMIT_EVENT_NAME as Z, hasActiveConnection as _, getWebhookKeysUrl as a, serverTimestamp as a0, now as a1, toSeconds as a2, toMillis as a3, getIdToken as a4, deriveUserIdentityFromIdToken as a5, getSessionGeneration as a6, WebSessionManager as a7, ReactNativeSessionManager as a8, getActiveSessionManager as a9, live as aA, intent as aB, status as aC, subscribeView as aD, LiveIntentError as aE, withEffects as aF, isEffectResult as aG, defineLiveModule as aH, EFFECT_INTENT_ADDRESS as aI, onSessionCleared as aa, SessionEnvironmentError as ab, UNSUPPORTED_ENVIRONMENT_CODE as ac, AUTH_CHANGED_CODE as ad, AUTH_EXPIRED_CODE as ae, isAuthExpiredError as af, getFreshAuthToken as ag, ServerSessionManager as ah, createSessionWithSignature as ai, refreshSession as aj, revokeSession as ak, signSessionCreateMessage as al, genAuthNonce as am, genSolanaMessage as an, createSolanaSignInRequest as ao, createSolanaSignInMessageText as ap, genSolanaSignInRequest as aq, genSolanaSignInMessage as ar, browserSignInDomain as as, SOLANA_SIGN_IN_STATEMENT as at, genSiweMessage as au, normalizeEvmAddress as av, toLowerEvmAddress as aw, functions as ax, invoke as ay, FunctionInvokeError as az, bufferExports as b, getConfiguredAppId as c, get as d, getMany as e, docId as f, getConfig as g, setMany as h, init as i, setFile as j, getFiles as k, search as l, markWriteNotApplied as m, runQueryMany as n, runExpression as o, runExpressionMany as p, queryAggregate as q, runQuery as r, set as s, signMessage as t, signTransaction as u, signAndSubmitTransaction as v, count as w, aggregate as x, reconcileSetResult as y, waitForSetResult as z };
11303
- //# sourceMappingURL=index-No5Vz0YM.mjs.map
11314
+ //# sourceMappingURL=index-CVWqE5hO.mjs.map