fix: remove deprecated PWA meta tag, add 3D gen timeout, quiet WS errors
Remove apple-mobile-web-app-capable (redundant with manifest.json display), add AbortController timeout + 524 handling for /api/3d-gen fetch, and downgrade CommunitySync WS error to console.warn since reconnect is automatic. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9008640f79
commit
8a82223b6f
|
|
@ -285,7 +285,7 @@ export class CommunitySync extends EventTarget {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.#ws.onerror = (error) => {
|
this.#ws.onerror = (error) => {
|
||||||
console.error("[CommunitySync] WebSocket error:", error);
|
console.warn("[CommunitySync] WebSocket error (will reconnect):", error);
|
||||||
this.dispatchEvent(new CustomEvent("error", { detail: error }));
|
this.dispatchEvent(new CustomEvent("error", { detail: error }));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -523,6 +523,8 @@ export class FolkSplatViewer extends HTMLElement {
|
||||||
progress.style.display = "block";
|
progress.style.display = "block";
|
||||||
status.textContent = "Preparing image...";
|
status.textContent = "Preparing image...";
|
||||||
|
|
||||||
|
const controller = new AbortController();
|
||||||
|
const timeout = setTimeout(() => controller.abort(), 90000);
|
||||||
try {
|
try {
|
||||||
// Resize image to max 1024px to reduce payload and improve API success
|
// Resize image to max 1024px to reduce payload and improve API success
|
||||||
const dataUrl = await this.resizeImage(selectedFile!, 1024);
|
const dataUrl = await this.resizeImage(selectedFile!, 1024);
|
||||||
|
|
@ -532,7 +534,17 @@ export class FolkSplatViewer extends HTMLElement {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ image_url: dataUrl }),
|
body: JSON.stringify({ image_url: dataUrl }),
|
||||||
|
signal: controller.signal,
|
||||||
});
|
});
|
||||||
|
clearTimeout(timeout);
|
||||||
|
|
||||||
|
if (res.status === 524) {
|
||||||
|
status.textContent = "Request timed out — the model took too long. Try a simpler image.";
|
||||||
|
progress.style.display = "none";
|
||||||
|
actions.style.display = "flex";
|
||||||
|
submitBtn.disabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (res.status === 503) {
|
if (res.status === 503) {
|
||||||
status.textContent = "AI generation not available — FAL_KEY not configured";
|
status.textContent = "AI generation not available — FAL_KEY not configured";
|
||||||
|
|
@ -561,8 +573,13 @@ export class FolkSplatViewer extends HTMLElement {
|
||||||
this._splatDesc = "AI-generated 3D model";
|
this._splatDesc = "AI-generated 3D model";
|
||||||
this._inlineViewer = true;
|
this._inlineViewer = true;
|
||||||
this.renderViewer();
|
this.renderViewer();
|
||||||
} catch (e) {
|
} catch (e: any) {
|
||||||
status.textContent = "Network error — could not reach server";
|
clearTimeout(timeout);
|
||||||
|
if (e.name === "AbortError") {
|
||||||
|
status.textContent = "Request timed out after 90s — try a simpler image.";
|
||||||
|
} else {
|
||||||
|
status.textContent = "Network error — could not reach server";
|
||||||
|
}
|
||||||
progress.style.display = "none";
|
progress.style.display = "none";
|
||||||
actions.style.display = "flex";
|
actions.style.display = "flex";
|
||||||
submitBtn.disabled = false;
|
submitBtn.disabled = false;
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,6 @@ export function renderShell(opts: ShellOptions): string {
|
||||||
<meta name="theme-color" content="#f5f5f0" media="(prefers-color-scheme: light)">
|
<meta name="theme-color" content="#f5f5f0" media="(prefers-color-scheme: light)">
|
||||||
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
|
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
||||||
<meta name="apple-mobile-web-app-title" content="rSpace">
|
<meta name="apple-mobile-web-app-title" content="rSpace">
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
<title>${escapeHtml(title)}</title>
|
<title>${escapeHtml(title)}</title>
|
||||||
|
|
@ -1517,7 +1516,6 @@ export function renderModuleLanding(opts: ModuleLandingOptions): string {
|
||||||
<meta name="theme-color" content="#f5f5f0" media="(prefers-color-scheme: light)">
|
<meta name="theme-color" content="#f5f5f0" media="(prefers-color-scheme: light)">
|
||||||
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
|
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
||||||
<meta name="apple-mobile-web-app-title" content="rSpace">
|
<meta name="apple-mobile-web-app-title" content="rSpace">
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
<title>${escapeHtml(mod.name)} — rSpace</title>
|
<title>${escapeHtml(mod.name)} — rSpace</title>
|
||||||
|
|
@ -1862,7 +1860,6 @@ export function renderSubPageInfo(opts: SubPageInfoOptions): string {
|
||||||
<meta name="theme-color" content="#f5f5f0" media="(prefers-color-scheme: light)">
|
<meta name="theme-color" content="#f5f5f0" media="(prefers-color-scheme: light)">
|
||||||
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
|
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
||||||
<meta name="apple-mobile-web-app-title" content="rSpace">
|
<meta name="apple-mobile-web-app-title" content="rSpace">
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
<title>${escapeHtml(subPage.title)} — ${escapeHtml(mod.name)} | rSpace</title>
|
<title>${escapeHtml(subPage.title)} — ${escapeHtml(mod.name)} | rSpace</title>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
<meta name="theme-color" content="#f5f5f0" media="(prefers-color-scheme: light)">
|
<meta name="theme-color" content="#f5f5f0" media="(prefers-color-scheme: light)">
|
||||||
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
|
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
||||||
<meta name="apple-mobile-web-app-title" content="rSpace">
|
<meta name="apple-mobile-web-app-title" content="rSpace">
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
<title>(you)rSpace — Collaborative Community Spaces</title>
|
<title>(you)rSpace — Collaborative Community Spaces</title>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue