@ultimat3/realtime 31.30.0 → 31.32.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultimat3/realtime",
3
- "version": "31.30.0",
3
+ "version": "31.32.0",
4
4
  "description": "Three-tier realtime: channels, live queries, local-first sync — one protocol, one mutator shape",
5
5
  "keywords": [
6
6
  "ultimate",
@@ -52,10 +52,10 @@
52
52
  "test": "bun test"
53
53
  },
54
54
  "dependencies": {
55
- "@ultimat3/core": "31.30.0",
56
- "@ultimat3/entity": "31.30.0",
57
- "@ultimat3/policy": "31.30.0",
58
- "@ultimat3/query": "31.30.0",
55
+ "@ultimat3/core": "31.32.0",
56
+ "@ultimat3/entity": "31.32.0",
57
+ "@ultimat3/policy": "31.32.0",
58
+ "@ultimat3/query": "31.32.0",
59
59
  "nats": "2.29.3"
60
60
  }
61
61
  }
package/src/errors.ts CHANGED
@@ -404,7 +404,7 @@ export class SocketOriginRefusedError extends RealtimeError {
404
404
  super({
405
405
  code: 'X_SOCKET_ORIGIN_REFUSED',
406
406
  cause: `the websocket upgrade was refused: ${args.reason} — asked from ${asked ?? 'an origin that cannot be rendered'}; this node admits ${list}`,
407
- fix: `export APP_URL=${asked ?? 'https://www.example.com'} # on the sync role, and only when that is the origin your pages are served on (or syncNode({ allowedOrigins }))`,
407
+ fix: `export APP_URL=${renderFixShellArg(asked, 'https://www.example.com')} # on the sync role, and only when that is the origin your pages are served on (or syncNode({ allowedOrigins }))`,
408
408
  });
409
409
  }
410
410
  }
package/src/use-query.ts CHANGED
@@ -206,12 +206,15 @@ function readAccessor<R extends object>(
206
206
  };
207
207
 
208
208
  /**
209
+ * Never named `fetch`: it shadowed the platform's in this scope, so a reader took a page read
210
+ * for a network call with no signal.
211
+ *
209
212
  * One answer: its rows, and — when the server sent the records envelope — the KEYS of this
210
213
  * read's records in answer order: `order[type]` where the server sent one, because an object
211
214
  * enumerates integer-like keys ascending; `records[type]`'s own key order where it did not.
212
215
  * The browser never derives a key: an answer with no records envelope holds its rows itself.
213
216
  */
214
- const fetch = (
217
+ const readAnswer = (
215
218
  append: boolean,
216
219
  ): Promise<{ rows: readonly Row[]; keys: string[] | null; next?: string | null }> => {
217
220
  let keysOf: string[] | null = null;
@@ -240,7 +243,7 @@ function readAccessor<R extends object>(
240
243
  const mine = ++generation;
241
244
  if (state.status === 'ready') state = { status: 'refreshing', data: rows() };
242
245
  bump();
243
- return fetch(append).then(
246
+ return readAnswer(append).then(
244
247
  (answer) => {
245
248
  if (released || mine !== generation) return;
246
249
  if (answer.next !== undefined) after = answer.next;