fix: double config path, stale service worker, empty op-name log
- main.go: DOCKER_PATH=/config + /config.json (was /config/config.json)
- vite.config.ts: skipWaiting+clientsClaim forces new SW immediately;
navigateFallback: null prevents SW from serving stale index.html;
globPatterns excludes HTML so navigation always hits the network
- server.go: gqlOpName handles shorthand { field } syntax
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,9 @@ export default defineConfig({
|
||||
vue(),
|
||||
VitePWA({
|
||||
registerType: 'autoUpdate',
|
||||
// Inject a cache-busting version based on build time so stale service
|
||||
// workers are replaced immediately when a new image is deployed.
|
||||
injectRegister: 'auto',
|
||||
manifest: {
|
||||
name: 'Archivum',
|
||||
short_name: 'Archivum',
|
||||
@@ -15,16 +18,26 @@ export default defineConfig({
|
||||
theme_color: '#0f172a',
|
||||
background_color: '#0f172a',
|
||||
display: 'standalone',
|
||||
// Icons are optional; add real PNG files to public/icons/ to enable PWA install.
|
||||
icons: [],
|
||||
},
|
||||
workbox: {
|
||||
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
|
||||
// Force the new service worker to activate immediately
|
||||
// instead of waiting for all tabs to close.
|
||||
skipWaiting: true,
|
||||
clientsClaim: true,
|
||||
// Only cache these explicit file types — do NOT cache HTML so the
|
||||
// SPA shell is always fetched fresh (prevents stale SW loops).
|
||||
globPatterns: ['**/*.{js,css,woff2,png,svg,ico}'],
|
||||
// Navigation requests (HTML) always go to the network.
|
||||
navigateFallback: null,
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: /\/graphql$/,
|
||||
handler: 'NetworkFirst',
|
||||
options: { cacheName: 'api-cache' },
|
||||
options: {
|
||||
cacheName: 'api-cache',
|
||||
networkTimeoutSeconds: 5,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user