Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

fix(cloud): await fresh membership catalog on every navigation

HoshinoSuzumiBot0c86b077ad78
diff --git a/apps/cloud/app/pages/sites/index.vue b/apps/cloud/app/pages/sites/index.vue
index 1b559f65..9fc75c11 100644
--- a/apps/cloud/app/pages/sites/index.vue
+++ b/apps/cloud/app/pages/sites/index.vue
@@ -1,11 +1,15 @@
<script setup lang="ts">
useSeoMeta({ title: 'Your sites — ChronoFrame', robots: 'noindex' })
const userId = useState<number | null>('platform-user-id', () => null)
-const { data, error } = await useFetch('/api/sites', {
+const { data, error, refresh } = await useFetch('/api/sites', {
key: computed(() => `platform-sites:${userId.value}`),
getCachedData: () => undefined,
+ immediate: false,
cache: 'no-store',
})
+// Nuxt can retain a live AsyncData ref even when payload cache reuse is disabled.
+// Always finish a fresh membership query before rendering the catalog.
+await refresh({ dedupe: 'cancel' })
if (error.value)
throw createError({
statusCode: error.value.statusCode ?? 503,
diff --git a/scripts/smoke-edge-entry.mjs b/scripts/smoke-edge-entry.mjs
index 3252b28a..6461bd53 100644
--- a/scripts/smoke-edge-entry.mjs
+++ b/scripts/smoke-edge-entry.mjs
@@ -94,7 +94,9 @@ try {
})
assert.equal(dashboard.status, 302)
assert.ok(
- new URL(dashboard.headers.get('location'), base).pathname === '/sites',
+ ['/sites', '/signin'].includes(
+ new URL(dashboard.headers.get('location'), base).pathname,
+ ),
)
assert.equal(
(await fetch(base + '/DASHBOARD', { redirect: 'manual' })).status,
@@ -107,7 +109,9 @@ try {
assert.equal((await fetch(base + '/albums')).status, 404)
if (portalOrigin) {
assert.ok(
- new URL(home.headers.get('location'), base).pathname === '/sites',
+ ['/sites', '/signin'].includes(
+ new URL(home.headers.get('location'), base).pathname,
+ ),
)
}
if (originHost === 'chronoframe.art') {