Compare commits

...

3 Commits

Author SHA1 Message Date
Jeff Emmett 48a5bf7d8a Merge branch 'dev'
CI/CD / deploy (push) Has been cancelled Details
2026-04-16 16:11:31 -04:00
Jeff Emmett 3d11acd48b chore(sw): bump cache version to v9 to purge stale HTML fragments
Stale cached HTML fragments referenced old asset hashes (e.g. 404 on
canvas-PlYnCtxh.js while server has canvas-R4rXE5Sc.js) after frequent
rebuilds. Bumping CACHE_VERSION and the SW registration query string
forces the new SW to install and purge all old versioned caches on
activate.
2026-04-16 16:11:29 -04:00
Jeff Emmett e3f322e7ff fix(rmeets): use subdomain-aware URLs everywhere
All internal rMeets links were hardcoded to /{space}/rmeets, so clicking
Quick Meet on https://demo.rspace.online/rmeets landed on
https://demo.rspace.online/demo/rmeets/<id> — a banned path-with-subdomain
URL. Added rmeetsBase(c) that returns /rmeets on {space}.rspace.online and
/{space}/rmeets elsewhere; swept all five `base` sites plus the inline
meeting page's meetsBase.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-16 15:55:27 -04:00
3 changed files with 17 additions and 10 deletions

View File

@ -38,6 +38,13 @@ const MI_API_URL = process.env.MEETING_INTELLIGENCE_API_URL || "http://meeting-i
const MI_INTERNAL_KEY = process.env.MI_INTERNAL_KEY || "";
const routes = new Hono();
// Subdomain-aware base for this module: `/rmeets` on {space}.rspace.online,
// `/{space}/rmeets` on localhost or bare domain.
function rmeetsBase(c: any): string {
const space = c.req.param("space") || "demo";
return c.get("isSubdomain") ? "/rmeets" : `/${escapeHtml(space)}/rmeets`;
}
// ── Meeting Intelligence API helper ──
async function miApiFetch(path: string, options?: { method?: string; body?: any }): Promise<{ ok: boolean; data?: any; error?: string }> {
@ -184,7 +191,7 @@ routes.get("/meet", (c) => {
routes.get("/recordings", async (c) => {
const space = c.req.param("space") || "demo";
const base = `/${escapeHtml(space)}/rmeets`;
const base = rmeetsBase(c);
const prefix = encodeURIComponent(space + "_");
const result = await miApiFetch(`/meetings?limit=50&sort=-created_at&conference_prefix=${prefix}`);
@ -240,7 +247,7 @@ routes.get("/recordings/:id", (c) => {
routes.get("/recordings/:id/:tab", async (c) => {
const space = c.req.param("space") || "demo";
const base = `/${escapeHtml(space)}/rmeets`;
const base = rmeetsBase(c);
const id = c.req.param("id");
const tab = c.req.param("tab") || "overview";
const validTabs = ["overview", "transcript", "summary", "speakers"];
@ -365,7 +372,7 @@ ${speakerList}`;
routes.get("/search", async (c) => {
const space = c.req.param("space") || "demo";
const base = `/${escapeHtml(space)}/rmeets`;
const base = rmeetsBase(c);
const q = c.req.query("q") || "";
let resultsHtml = "";
@ -445,7 +452,7 @@ routes.all("/api/mi-proxy/*", async (c) => {
routes.get("/", (c) => {
const space = c.req.param("space") || "demo";
const base = `/${escapeHtml(space)}/rmeets`;
const base = rmeetsBase(c);
const randomId = Math.random().toString(36).slice(2, 10);
return c.html(renderShell({
title: `rMeets — ${space} | rSpace`,
@ -526,7 +533,7 @@ routes.get("/", (c) => {
routes.get("/meeting-intelligence", async (c) => {
const space = c.req.param("space") || "demo";
const base = `/${escapeHtml(space)}/rmeets`;
const base = rmeetsBase(c);
const prefix = encodeURIComponent(space + "_");
// Fetch space-scoped meetings from MI API
@ -674,7 +681,7 @@ routes.get("/:room", (c) => {
// Default: clean full-screen Jitsi — no rSpace shell, mobile-friendly
const jitsiRoom = encodeURIComponent(space + "_" + room);
const meetsBase = `/${escapeHtml(space)}/rmeets`;
const meetsBase = rmeetsBase(c);
return c.html(`<!DOCTYPE html>
<html lang="en">
<head>

View File

@ -369,7 +369,7 @@ export function renderShell(opts: ShellOptions): string {
// Service worker registration + update detection
if ("serviceWorker" in navigator && location.hostname !== "localhost") {
navigator.serviceWorker.register("/sw.js?v=8").then((reg) => {
navigator.serviceWorker.register("/sw.js?v=9").then((reg) => {
function showUpdateBanner() {
if (!isStandalone) return; // Only show update prompt in installed PWA
if (sessionStorage.getItem('rspace_update_dismissed')) return; // dismissed this session
@ -2304,7 +2304,7 @@ export function renderModuleLanding(opts: ModuleLandingOptions): string {
<script type="module">
import '/shell.js';
if ("serviceWorker" in navigator && location.hostname !== "localhost") {
navigator.serviceWorker.register("/sw.js?v=8").catch(() => {});
navigator.serviceWorker.register("/sw.js?v=9").catch(() => {});
}
document.querySelector('rstack-app-switcher')?.setModules(${moduleListJSON});
try {
@ -2644,7 +2644,7 @@ export function renderSubPageInfo(opts: SubPageInfoOptions): string {
<script type="module">
import '/shell.js';
if ("serviceWorker" in navigator && location.hostname !== "localhost") {
navigator.serviceWorker.register("/sw.js?v=8").catch(() => {});
navigator.serviceWorker.register("/sw.js?v=9").catch(() => {});
}
document.querySelector('rstack-app-switcher')?.setModules(${moduleListJSON});
try {

View File

@ -1,7 +1,7 @@
/// <reference lib="webworker" />
declare const self: ServiceWorkerGlobalScope;
const CACHE_VERSION = "rspace-v8";
const CACHE_VERSION = "rspace-v9";
const STATIC_CACHE = `${CACHE_VERSION}-static`;
const HTML_CACHE = `${CACHE_VERSION}-html`;
const API_CACHE = `${CACHE_VERSION}-api`;