@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/dist/index.js
CHANGED
|
@@ -5703,6 +5703,7 @@ async function compositeCroppedFrame(args) {
|
|
|
5703
5703
|
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
5704
5704
|
var DEFAULT_ARTBOARD_SIZE = 2e3;
|
|
5705
5705
|
var MAX_CONCURRENT_BLOBS = 5;
|
|
5706
|
+
var FRAME_SUPERSEDE_GRACE_MS = 2e3;
|
|
5706
5707
|
function mergeMockupIds(current, extra) {
|
|
5707
5708
|
const out = [...current];
|
|
5708
5709
|
for (const id of extra) if (!out.includes(id)) out.push(id);
|
|
@@ -6095,6 +6096,22 @@ function RealtimeProvider({
|
|
|
6095
6096
|
if (gen !== sceneGenRef.current || compositeQueueRef.current.has(result.mockupId) || processedFrameRef.current.get(result.mockupId) !== result.imageUrl) {
|
|
6096
6097
|
return;
|
|
6097
6098
|
}
|
|
6099
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
6100
|
+
if (result.imageUrl.startsWith("blob:") && message.startsWith("E_OVERLAY_FRAME_LOAD") && message.includes(result.imageUrl.slice(0, 160))) {
|
|
6101
|
+
const failedUrl = result.imageUrl;
|
|
6102
|
+
setTimeout(() => {
|
|
6103
|
+
if (gen !== sceneGenRef.current) return;
|
|
6104
|
+
if (compositeQueueRef.current.has(result.mockupId)) return;
|
|
6105
|
+
if (processedFrameRef.current.get(result.mockupId) !== failedUrl) return;
|
|
6106
|
+
console.error(
|
|
6107
|
+
`[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.`,
|
|
6108
|
+
err
|
|
6109
|
+
);
|
|
6110
|
+
cropCapableRef.current = false;
|
|
6111
|
+
rerenderFullFrame(result.mockupId);
|
|
6112
|
+
}, FRAME_SUPERSEDE_GRACE_MS);
|
|
6113
|
+
return;
|
|
6114
|
+
}
|
|
6098
6115
|
console.error(
|
|
6099
6116
|
"[RealtimeProvider] E_OVERLAY_COMPOSITE_FAILED: cropped-frame composite failed \u2014 full-frame delivery for the rest of this session.",
|
|
6100
6117
|
err
|