@snowcone-app/sdk 0.29.0 → 0.29.1

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
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.29.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#4643](https://github.com/snowcone-app/snowcone-monorepo/pull/4643) [`af17a28`](https://github.com/snowcone-app/snowcone-monorepo/commit/af17a28ff9a11fa6e59efb83aff3c8dae863a082) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Realtime frame flow control: an `all_mockups_rendered` summary that arrives before its frames (they wait behind the ack window) no longer replaces the frame a picture still has to draw. It was lost, never drawn or acked, and the box waited out its 5 s ack timeout (`E_RT_ACK_TIMEOUT`) on every picture of the gallery. A frame dropped by the per-picture bound (`E_BLOB_PICTURE_BOUND`) is now acked too.
8
+
3
9
  ## 0.29.0
4
10
 
5
11
  ### Minor Changes
@@ -370,17 +370,23 @@ var RealtimeMockupService = class {
370
370
  }
371
371
  return true;
372
372
  });
373
- const batch = freshMockups.map((mockup) => {
373
+ const batch = freshMockups.flatMap((mockup) => {
374
374
  const existing = this.mockupResults.find(
375
375
  (m) => m.mockupId === mockup.mockupId && (mockup.requestId === void 0 || m.requestId === mockup.requestId)
376
376
  );
377
- if (!existing) return mockup;
377
+ if (!existing) {
378
+ if (!mockup.imageUrl) {
379
+ const held = this.mockupResults.find((m) => m.mockupId === mockup.mockupId && m.imageUrl);
380
+ return held ? [held] : [];
381
+ }
382
+ return [mockup];
383
+ }
378
384
  const merged = { ...existing, ...pruneUndefined(mockup) };
379
385
  if (existing.imageUrl.startsWith("blob:")) {
380
386
  merged.imageUrl = existing.imageUrl;
381
387
  merged.renderUrl = existing.renderUrl;
382
388
  }
383
- return merged;
389
+ return [merged];
384
390
  });
385
391
  const batchById = new Map(batch.map((m) => [m.mockupId, m]));
386
392
  this.mockupResults = [
package/dist/index.cjs CHANGED
@@ -5443,17 +5443,23 @@ var RealtimeMockupService = class {
5443
5443
  }
5444
5444
  return true;
5445
5445
  });
5446
- const batch = freshMockups.map((mockup) => {
5446
+ const batch = freshMockups.flatMap((mockup) => {
5447
5447
  const existing = this.mockupResults.find(
5448
5448
  (m) => m.mockupId === mockup.mockupId && (mockup.requestId === void 0 || m.requestId === mockup.requestId)
5449
5449
  );
5450
- if (!existing) return mockup;
5450
+ if (!existing) {
5451
+ if (!mockup.imageUrl) {
5452
+ const held = this.mockupResults.find((m) => m.mockupId === mockup.mockupId && m.imageUrl);
5453
+ return held ? [held] : [];
5454
+ }
5455
+ return [mockup];
5456
+ }
5451
5457
  const merged = { ...existing, ...pruneUndefined(mockup) };
5452
5458
  if (existing.imageUrl.startsWith("blob:")) {
5453
5459
  merged.imageUrl = existing.imageUrl;
5454
5460
  merged.renderUrl = existing.renderUrl;
5455
5461
  }
5456
- return merged;
5462
+ return [merged];
5457
5463
  });
5458
5464
  const batchById = new Map(batch.map((m) => [m.mockupId, m]));
5459
5465
  this.mockupResults = [
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  REALTIME_WS_URL,
3
3
  RealtimeMockupService
4
- } from "./chunk-IW7DXXGY.js";
4
+ } from "./chunk-4FZOZLWF.js";
5
5
  import {
6
6
  createDevFetcher
7
7
  } from "./chunk-7VO4EL2V.js";
package/dist/react.cjs CHANGED
@@ -404,17 +404,23 @@ var RealtimeMockupService = class {
404
404
  }
405
405
  return true;
406
406
  });
407
- const batch = freshMockups.map((mockup) => {
407
+ const batch = freshMockups.flatMap((mockup) => {
408
408
  const existing = this.mockupResults.find(
409
409
  (m) => m.mockupId === mockup.mockupId && (mockup.requestId === void 0 || m.requestId === mockup.requestId)
410
410
  );
411
- if (!existing) return mockup;
411
+ if (!existing) {
412
+ if (!mockup.imageUrl) {
413
+ const held = this.mockupResults.find((m) => m.mockupId === mockup.mockupId && m.imageUrl);
414
+ return held ? [held] : [];
415
+ }
416
+ return [mockup];
417
+ }
412
418
  const merged = { ...existing, ...pruneUndefined(mockup) };
413
419
  if (existing.imageUrl.startsWith("blob:")) {
414
420
  merged.imageUrl = existing.imageUrl;
415
421
  merged.renderUrl = existing.renderUrl;
416
422
  }
417
- return merged;
423
+ return [merged];
418
424
  });
419
425
  const batchById = new Map(batch.map((m) => [m.mockupId, m]));
420
426
  this.mockupResults = [
package/dist/react.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RealtimeMockupService
3
- } from "./chunk-IW7DXXGY.js";
3
+ } from "./chunk-4FZOZLWF.js";
4
4
 
5
5
  // src/realtime/react.ts
6
6
  import { useCallback, useEffect, useRef, useState } from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snowcone-app/sdk",
3
- "version": "0.29.0",
3
+ "version": "0.29.1",
4
4
  "description": "Snowcone SDK for product mockups and print-on-demand",
5
5
  "keywords": [
6
6
  "merch",