Skip to content

🐛 qooxdoo-kit: fix translation race in compiler (multi-app builds drop translations)#92

Merged
odeimaiz merged 2 commits into
masterfrom
fix/qooxdoo-kit-translations
Jun 16, 2026
Merged

🐛 qooxdoo-kit: fix translation race in compiler (multi-app builds drop translations)#92
odeimaiz merged 2 commits into
masterfrom
fix/qooxdoo-kit-translations

Conversation

@odeimaiz

@odeimaiz odeimaiz commented Jun 16, 2026

Copy link
Copy Markdown
Member

Patches a race condition in @qooxdoo/compiler that causes translation catalogs to be dropped when several applications that share a library are compiled together. The fix is carried as a vendored patch applied to the compiler at image-build time.

Why

In osparc-simcore all 9 products (osparc, s4l, s4llite, s4lacad, …) share the
single osparc library and are compiled concurrently by qx compile. With the released
Spanish (es) translations, only one random product actually shipped the catalog; all
the others rendered English. On the deployed products qx.$$translations.es was empty
(Object.keys(...).length === 0) even though the bundle's qx.$$packageData[0].translations.es
was correct — the catalog was simply never written into those apps.

Root cause

A race in Analyser.getTranslation():

getTranslation: async function(library, locale) {
  var id = locale + ":" + library.getNamespace();
  var translation = t.__translations[id];
  if (!translation) {
    translation = t.__translations[id] = new Translation(library, locale); // cached synchronously
    translation.setWriteLineNumbers(this.isWritePoLineNumbers());
    await translation.checkRead();   // only the FIRST caller awaits the .po read
  }
  return translation;                // concurrent callers return the still-empty object
}

@odeimaiz odeimaiz self-assigned this Jun 16, 2026
@odeimaiz odeimaiz changed the title patch 🐛 qooxdoo-kit: fix translation race in compiler (multi-app builds drop translations) Jun 16, 2026
@odeimaiz
odeimaiz requested a review from Copilot June 16, 2026 11:59
@odeimaiz odeimaiz added this to the RokosBasilisk milestone Jun 16, 2026
@odeimaiz odeimaiz added the bug Something isn't working label Jun 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR vendors and applies a patch to @qooxdoo/compiler during the qooxdoo-kit image build to fix a concurrency bug where shared-library translation catalogs can be dropped in multi-app builds.

Changes:

  • Add a patch (qx-compiler-translation-race.patch) that ensures concurrent callers of Analyser.getTranslation() all await translation.checkRead().
  • Update the qooxdoo-kit Docker image to install patch and apply vendored patches to the installed compiler package at build time.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
qooxdoo-kit/patches/qx-compiler-translation-race.patch Adds a targeted upstream patch to fix the translation read race in the compiler.
qooxdoo-kit/Dockerfile Installs patch and applies the vendored patch(es) to @qooxdoo/compiler during image build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread qooxdoo-kit/Dockerfile Outdated

@GitHK GitHK left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: why patch instead of updating the complier a version 1.0.5 is currently out?
We are using a 7 year old version 1.0.0-beta.20190807-0955

@odeimaiz

Copy link
Copy Markdown
Member Author

Q: why patch instead of updating the complier a version 1.0.5 is currently out?

Because updating the compiler and framework have been in my list for a while, but it's not as easy as changing the number of the pinned version.

This solution is faster.

@odeimaiz
odeimaiz merged commit 9cadd1a into master Jun 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants