Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[bug]: first load after an update shows raw translation keys (service worker serves stale locales)

Chiusa
#9,908 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Una pull request collegata è già stata integrata.

  • #9947 di @Pfannkuchensack — integrata

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
70/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend, web-dev

Direzione di ricerca

Start with invokeai/frontend/webv2/src/platform/pwa/sw.js, especially the invokeai-runtime cache and LOCALES_PREFIX handling, then trace locale loading in invokeai/frontend/webv2/src/platform/i18n/client.ts. Reproduce the two-reload behavior after rebuilding and confirm that the first load no longer combines the new bundle with stale locale data. Done means updated locale files are used on the first load after an update while the existing offline behavior remains intact.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is there an existing issue for this problem?
  • I have searched the existing issues
Install method

Manual (dev checkout)

Operating system

Windows

GPU vendor

Any (frontend)

Version number

main at de172fa768

Browser

Chromium 14x (Playwright), Chrome

What happened

After updating Invoke, the first page load shows new UI strings as raw translation keys. For example, an icon button's accessible name was models.workingMemory.aboutColumn instead of "About Measured". A second reload fixes it.

Cause (invokeai/frontend/webv2/src/platform/pwa/sw.js):

  • The app shell and assets are versioned: invokeai-shell-${MANIFEST.version}, and ASSET_URLS from the build manifest.
  • locales/*.json are served stale-while-revalidate from the unversioned invokeai-runtime cache (respondStaleWhileRevalidate, used for LOCALES_PREFIX).
  • src/platform/i18n/client.ts loads them from an unversioned URL (/locales/{{lng}}.json).
  • activate clears old shell caches and stale assets, but not the runtime cache.

So the first load after an update runs the new JS bundle against the previous build's locale file. The background refresh puts the new file into the cache, and only the next load picks it up. The server sends cache-control: no-store for the locale file, but the service worker answers from its own cache before the network is consulted.

What you expected to happen

The first load after an update shows the new build's strings.

How to reproduce the problem
  1. Open the app once, so the service worker is installed and has cached locales/en.json.
  2. Add a key to public/locales/en.json and use it in a component, then rebuild (pnpm build) and restart the server.
  3. Reload the page once. The new string renders as its key.
  4. Reload again. The string is correct.
Additional context

Possible fixes:

  • version the locale URL, e.g. a build hash in the file name or a ?v= from the manifest, so the runtime cache misses after an update;
  • or clear locales/ entries from invokeai-runtime in activate when the shell version changes;
  • or serve locales network-first and fall back to the cache only when offline.

The release case matters most: every update that adds strings shows raw keys to every returning user on their first visit.

Lingua principale
TypeScript
Stelle
28.6k
Fork
3k
Merge medio
3g 2h
PR unite (30g)
133

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di invoke-ai/InvokeAI

Tutte le issue di invoke-ai/InvokeAI

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.