Skip to content

Fix authenticated manifests and network-first PWA refresh - #37

Closed
harikiran-lab wants to merge 1 commit into
TraceApps:devfrom
harikiran-lab:codex/upstream-pwa-refresh
Closed

harikiran-lab wants to merge 1 commit into
TraceApps:devfrom
harikiran-lab:codex/upstream-pwa-refresh

Conversation

@harikiran-lab

Copy link
Copy Markdown
Contributor

A protected manifest.webmanifest is fetched without session cookies by default, redirecting it to an SSO page and causing a manifest CORS failure. The manifest link now uses credentials.

Refreshes were also intercepted by Workbox’s precached navigation shell before the configured NetworkFirst route. Disable both navigation fallback and directory-index aliases, retain an offline shell fallback, avoid caching authentication redirects, and honor the update prompt before worker activation. A content-versioned font stylesheet prevents an updated app from reusing older font definitions.

Validation: 25 focused tests and the production build pass. Browser tests reproduced the old-worker upgrade, verified normal refreshes reach the server, confirmed manifest cookies through an authenticated test proxy, and exercised offline fallback. Based on current upstream dev. No workflow changes.

thebigjoe1 added a commit that referenced this pull request Oct 27, 2026
The manifest is fetched with the proxy's cookie, and page loads go to the
server first, so a reload gets the new version and an expired proxy session
shows its sign-in page. The cached app opens offline, after 3 seconds, or on
a 5xx; nothing is stored from page loads.

Co-authored-by: harikiran-lab <[email protected]>
thebigjoe1 added a commit to TraceApps/docs that referenced this pull request Oct 27, 2026
thebigjoe1 added a commit that referenced this pull request Oct 28, 2026
Startup check and reads get deadlines (src/lib/request-deadline.js), so the
kept copy opens instead of an empty page; while the server is quiet, changes
queue unless one sent before is still waiting. Page loads of the API and
uploads are no longer stored, and the old pages-cache is deleted.
thebigjoe1 added a commit to TraceApps/nutritrace that referenced this pull request Oct 28, 2026
…offline (from TraceApps/notetrace#37)

The manifest is fetched with the proxy's cookie and page loads go to the
server first, with the cached app offline, after 3 seconds or on a 5xx.
Startup check and reads get deadlines (src/lib/request-deadline.js), so a
server that never answers opens the kept copy within seconds. Page loads
of the API and uploads are no longer stored, the old pages-cache is deleted.
Logout also deletes uploads-cache.

Co-authored-by: harikiran-lab <[email protected]>
thebigjoe1 added a commit to TraceApps/cooktrace that referenced this pull request Oct 28, 2026
…offline (from TraceApps/notetrace#37)

The manifest is fetched with the proxy's cookie and page loads go to the
server first, with the cached app offline, after 3 seconds or on a 5xx.
Startup check and reads get deadlines (src/lib/request-deadline.js), so a
server that never answers opens the kept copy within seconds. Page loads
of the API and uploads are no longer stored, the old pages-cache is deleted.
Logout also deletes uploads-cache.

Co-authored-by: harikiran-lab <[email protected]>
thebigjoe1 added a commit to TraceApps/lifttrace that referenced this pull request Oct 28, 2026
…offline (from TraceApps/notetrace#37)

The manifest is fetched with the proxy's cookie and page loads go to the
server first, with the cached app offline, after 3 seconds or on a 5xx.
Startup check and reads get deadlines (src/lib/request-deadline.js), so a
server that never answers opens the kept copy within seconds. Page loads
of the API and uploads are no longer stored, the old pages-cache is deleted.
Single Sign-On settings read __LT_CONFIG__, so a provider's suggested redirect address includes BASE_URL.

Co-authored-by: harikiran-lab <[email protected]>
@thebigjoe1

Copy link
Copy Markdown
Contributor

Thanks for tracking this down! Both problems were real. I fixed them a bit differently so the app still opens offline: page loads go to the server first, and the manifest is sent with the proxy's cookie. It's on dev in all four apps, and you're credited in the changelogs, so I'm closing this one.

@thebigjoe1 thebigjoe1 closed this Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants