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) => {
|
||||
console.error("[CommunitySync] WebSocket error:", error);
|
||||
console.warn("[CommunitySync] WebSocket error (will reconnect):", error);
|
||||
this.dispatchEvent(new CustomEvent("error", { detail: error }));
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -523,6 +523,8 @@ export class FolkSplatViewer extends HTMLElement {
|
|||
progress.style.display = "block";
|
||||
status.textContent = "Preparing image...";
|
||||
|
||||
const controller = new AbortController();
|
||||
const timeout = setTimeout(() => controller.abort(), 90000);
|
||||
try {
|
||||
// Resize image to max 1024px to reduce payload and improve API success
|
||||
const dataUrl = await this.resizeImage(selectedFile!, 1024);
|
||||
|
|
@ -532,7 +534,17 @@ export class FolkSplatViewer extends HTMLElement {
|
|||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
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) {
|
||||
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._inlineViewer = true;
|
||||
this.renderViewer();
|
||||
} catch (e) {
|
||||
status.textContent = "Network error — could not reach server";
|
||||
} catch (e: any) {
|
||||
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";
|
||||
actions.style.display = "flex";
|
||||
submitBtn.disabled = false;
|
||||
|
|
|
|||
|
|
@ -120,7 +120,6 @@ export function renderShell(opts: ShellOptions): string {
|
|||
<meta name="theme-color" content="#f5f5f0" media="(prefers-color-scheme: light)">
|
||||
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
|
||||
<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-status-bar-style" content="black-translucent">
|
||||
<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)">
|
||||
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
|
||||
<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-status-bar-style" content="black-translucent">
|
||||
<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)">
|
||||
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
|
||||
<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-status-bar-style" content="black-translucent">
|
||||
<title>${escapeHtml(subPage.title)} — ${escapeHtml(mod.name)} | rSpace</title>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
<meta name="theme-color" content="#f5f5f0" media="(prefers-color-scheme: light)">
|
||||
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
|
||||
<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-status-bar-style" content="black-translucent">
|
||||
<title>(you)rSpace — Collaborative Community Spaces</title>
|
||||
|
|
|
|||
Loading…
Reference in New Issue