@snowcone-app/ui 0.9.4 → 0.9.5
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 +6 -0
- package/dist/index.cjs +17 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/patterns/RealtimeProvider.tsx +29 -0
- package/src/patterns/__tests__/RealtimeProvider.cropDelivery.test.tsx +41 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4351](https://github.com/snowcone-app/snowcone-monorepo/pull/4351) [`f9910a8`](https://github.com/snowcone-app/snowcone-monorepo/commit/f9910a86ec7d3ee48d9d4fbd5099f4790ce91e98) Thanks [@kevinsproles](https://github.com/kevinsproles)! - A cropped frame whose blob: URL was already revoked (its newer frame reached the SDK before React state delivered it) no longer switches the session to full-frame delivery: it waits up to 2 s for the newer frame, and only counts as a real failure if none arrives.
|
|
8
|
+
|
|
3
9
|
## 0.9.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -6062,6 +6062,7 @@ async function compositeCroppedFrame(args) {
|
|
|
6062
6062
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
6063
6063
|
var DEFAULT_ARTBOARD_SIZE = 2e3;
|
|
6064
6064
|
var MAX_CONCURRENT_BLOBS = 5;
|
|
6065
|
+
var FRAME_SUPERSEDE_GRACE_MS = 2e3;
|
|
6065
6066
|
function mergeMockupIds(current, extra) {
|
|
6066
6067
|
const out = [...current];
|
|
6067
6068
|
for (const id of extra) if (!out.includes(id)) out.push(id);
|
|
@@ -6454,6 +6455,22 @@ function RealtimeProvider({
|
|
|
6454
6455
|
if (gen !== sceneGenRef.current || compositeQueueRef.current.has(result.mockupId) || processedFrameRef.current.get(result.mockupId) !== result.imageUrl) {
|
|
6455
6456
|
return;
|
|
6456
6457
|
}
|
|
6458
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
6459
|
+
if (result.imageUrl.startsWith("blob:") && message.startsWith("E_OVERLAY_FRAME_LOAD") && message.includes(result.imageUrl.slice(0, 160))) {
|
|
6460
|
+
const failedUrl = result.imageUrl;
|
|
6461
|
+
setTimeout(() => {
|
|
6462
|
+
if (gen !== sceneGenRef.current) return;
|
|
6463
|
+
if (compositeQueueRef.current.has(result.mockupId)) return;
|
|
6464
|
+
if (processedFrameRef.current.get(result.mockupId) !== failedUrl) return;
|
|
6465
|
+
console.error(
|
|
6466
|
+
`[RealtimeProvider] E_OVERLAY_COMPOSITE_FAILED: frame for ${result.mockupId} failed to load and no newer frame arrived within ${FRAME_SUPERSEDE_GRACE_MS} ms \u2014 full-frame delivery for the rest of this session.`,
|
|
6467
|
+
err
|
|
6468
|
+
);
|
|
6469
|
+
cropCapableRef.current = false;
|
|
6470
|
+
rerenderFullFrame(result.mockupId);
|
|
6471
|
+
}, FRAME_SUPERSEDE_GRACE_MS);
|
|
6472
|
+
return;
|
|
6473
|
+
}
|
|
6457
6474
|
console.error(
|
|
6458
6475
|
"[RealtimeProvider] E_OVERLAY_COMPOSITE_FAILED: cropped-frame composite failed \u2014 full-frame delivery for the rest of this session.",
|
|
6459
6476
|
err
|