panel icon indicating copy to clipboard operation
panel copied to clipboard

[2.0] Extension translations stay cached after an extension is updated

Open BletzziDev opened this issue 1 month ago • 2 comments

Current Behavior

Extension translations stay stale in the browser after an extension is updated, so new strings render as raw keys (for example ui.summary) and changed strings keep their old text.

Extension translation groups are loaded through /locales/locale.json?locale=en&namespace=ext-<id>::messages&hash=<build hash> (resources/scripts/i18n.ts). The hash query parameter is the panel's own build hash (import.meta.env.WEBPACK_BUILD_HASH), and LocaleController answers with Cache-Control: public, max-age=3600, stale-while-revalidate=86400.

Installing, upgrading or enabling an extension does not change the panel build hash, so the URL stays the same and the browser keeps serving the previous version of the extension's resources/lang/<locale>/messages.php for up to an hour, and up to a day stale. The server already returns the new strings; only the cached response is old.

Expected Behavior

After an extension is installed or upgraded and the page is reloaded (as the SDK docs instruct), its translations should match the installed version, the same way its frontend bundle does (/assets/extensions/<id>/<sha256>/client.js changes with each build).

Possible fixes: include a fingerprint of the enabled extensions (id + version or asset hash) in the hash query parameter for ext-* namespaces, or serve extension namespaces with no-cache and rely on the ETag that is already sent.

Steps to Reproduce

  1. Install an extension that registers translations with loadExtensionTranslations() and reads them with useExtensionTranslation('messages').
  2. Open a page that uses those strings, so the browser caches /locales/locale.json?...&namespace=ext-<id>::messages.
  3. Add a new key to resources/lang/en/messages.php (and use it in the frontend), rebuild, then php artisan p:extension:install <package> --enable.
  4. Reload the page normally.
  5. The new key renders as the raw key; curl on the same URL shows the server already returns the new string. A hard reload (bypassing the cache) fixes it.

Panel Version

2.0.0-dev (2.0-develop @ d3410f8)

Wings Version

1.13.3

Games and/or Eggs Affected

None (panel UI)

Docker Image

No response

Error Logs

No response

Is there an existing issue for this?

  • [X] I have searched the existing issues before opening this issue. I understand that maintainers may close this issue without communication if I have not provided sufficient information.

BletzziDev avatar Oct 06 '26 03:10 BletzziDev

Just a quick advice about this issue: This issue description i wrote with AI Help tool (Claude code Opus 5.5) to mantain a better undestanding of the issue for the pterodactyl developers, i reviewed the bugs before posting.

The bug ocurred while i was developing a extension for the panel 2.0 version, when i updated the extension the new strings become raw keys instead the translation. I did requests on the backend and i saw that the server was already sending the new translations, so only a hard reload on the page (CMD + SHIFT + R) has resolved the situation.

BletzziDev avatar Oct 06 '26 03:10 BletzziDev

Fixed by e52fdfd416a26d08032f7747800cd849d3b2c856

anthonyphysgun avatar Oct 06 '26 05:10 anthonyphysgun