ui: Remove PWA navigate fallback to prevent caching API endpoint requests (#25174)

This commit is contained in:
Aleksander Grygier
2026-07-01 07:32:55 +02:00
committed by GitHub
parent fd1a05791d
commit 7af4279f45
3 changed files with 18 additions and 10 deletions
+4 -1
View File
@@ -43,7 +43,10 @@ test.describe('PWA Service Worker', () => {
expect(swContent).toMatch(/"_app\/immutable\/assets\/bundle\.[a-zA-Z0-9_-]+\.css"/);
expect(swContent).toMatch(/"manifest\.webmanifest"/);
expect(swContent).toMatch(/"_app\/version\.json"/);
expect(swContent).toMatch(/NavigationRoute/);
// NavigationRoute is intentionally absent — server API endpoints
// (e.g. /slots, /models) must not be intercepted by the PWA and
// should return JSON directly from the server.
expect(swContent).not.toMatch(/NavigationRoute/);
expect(swContent).toMatch(/api-cache/);
});
+4 -2
View File
@@ -108,9 +108,11 @@ describe('PWA Build Output', () => {
expect(swContent).toMatch(/"manifest\.webmanifest"/);
});
it('has navigation route registered', () => {
it('no navigation route — API endpoints bypass PWA', () => {
expect(swContent).toBeTruthy();
expect(swContent).toMatch(/NavigationRoute/);
// NavigationRoute is intentionally absent so direct browser
// navigation to server API endpoints returns JSON, not HTML.
expect(swContent).not.toMatch(/NavigationRoute/);
});
it('has runtime caching for API routes', () => {