Commit Graph

9 Commits

Author SHA1 Message Date
Scott Idem
26ab5dda75 fix(service-worker): exclude /fonts/ from SW precache
667 font files (~134MB) were being passed to cache.addAll() on every SW
install. cache.addAll() is atomic — a single failed request aborts the
entire install. Browser Cache Storage quota is typically 50-100MB on
mobile, so the SW has likely been silently failing to install on most
mobile devices, negating all caching and the skipWaiting fix.

Only 3 font files are referenced by the browser (app.css). The rest are
badge-print fonts for server/Electron use and do not need to be precached.
The browser's normal HTTP cache handles them when the print page is visited.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03 20:00:22 -04:00
Scott Idem
59fc7cabc6 fix(service-worker): add skipWaiting + clients.claim for immediate activation
Without these two calls, a new service worker installs in the background but
sits in 'waiting' state until every tab running the old version is closed.
Users who leave idaa.org open all day (common for IDAA members in the iframe)
would run the old JS bundle for hours or days after a fix is deployed, with no
indication that an update exists.

skipWaiting() — new SW activates immediately after install instead of waiting
clients.claim() — new SW takes control of all open tabs right away

This is the most likely root cause of "can't reproduce in testing but users
keep seeing the error": developers refresh/close tabs constantly, end users
don't. The old broken code kept running in their long-lived browser sessions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03 18:35:34 -04:00
Scott Idem
978a9a6960 Clarify service worker cross-origin guard 2026-05-13 15:13:27 -04:00
Scott Idem
82430649db Fix iframe reload and service worker caching 2026-05-13 15:08:17 -04:00
Scott Idem
a8f3c29b9f Last round of prettier: npx prettier --write src/ 2026-03-24 13:27:40 -04:00
Scott Idem
0a390c9505 feat(sw): implement and enable robust service worker caching
- Re-enabled automatic service worker registration in svelte.config.js.
- Implemented a production-ready service-worker.js using SvelteKit metadata (-worker).
- Added intelligent caching for build artifacts, static files, and network fallbacks.
- This ensures the UI shell and assets load instantly from disk, completing the hydration performance workstream.
2026-01-26 17:19:30 -05:00
Scott Idem
8fae3aa89a Fix(ServiceWorker): Mitigate persistent TypeError by disabling auto-registration
- Mitigation: Disabled `serviceWorker.register` in `svelte.config.js` to stop the loop of `TypeError` during script evaluation.
- Debug Tool: Preserved the `fix-sw` cache clearing utility by moving it to `src/routes/testing/fix-sw/+page.svelte` for future investigation.
- Service Worker: Simplified `src/service-worker.js` to a minimal "Hello World" state and removed the problematic `.ts` version.
- Cleanup: Minor formatting adjustment in `ae_events_functions.ts`.
- Docs: Updated `TODO.md` and `GEMINI.md` to reflect the mitigation and planned follow-up.
2026-01-21 16:49:33 -05:00
Scott Idem
09c7d2440a Fix: Harden V3 search logic and restore specialized business mapping
- API: Updated `search_ae_obj_v3` to correctly serialize complex URL parameters (JSON).
- Events: Restored "sacred" business logic for Event Badge and Session searches using `ft_qry` and `lk_qry`.
- PWA: Fixed manifest path in `app.html` to resolve 404 errors.
- Documentation: Updated `GEMINI.md` and `TODO.md` with recent search hardening accomplishments.
2026-01-21 15:27:53 -05:00
Scott Idem
0b2ed6ce08 feat(pwa): implement dynamic manifest.webmanifest and service worker for multi-tenant support 2026-01-16 19:09:03 -05:00