Skip to content

Fix extractor reference races and deduplicate source references#59

Merged
perpetualKid merged 3 commits into
perpetualKid:mainfrom
volodymyrkorobkin:fix-extractor-threading-issue
May 17, 2026
Merged

Fix extractor reference races and deduplicate source references#59
perpetualKid merged 3 commits into
perpetualKid:mainfrom
volodymyrkorobkin:fix-extractor-threading-issue

Conversation

@volodymyrkorobkin
Copy link
Copy Markdown

@volodymyrkorobkin volodymyrkorobkin commented May 13, 2026

Fix issue in GetText.Extractor, where source references in generated .pot could be incomplete. And also an issue that those references can contain duplicates, when plural form is used.

  • Made CatalogTemplate.AddOrUpdateEntry(...) updates thread-safe per catalog entry. This fixed nondeterministic loss of source references during parallel extraction.
  • In CatalogTemplate.AddOrUpdateEntry(..) with plural form: reference is now added only when it is not added before, the same way as it already was done in non plural version if this method.

Also extracted some duplicate logic into the newly introduced CatalogTemplate.GetOrAddEntry(...).

Added unit tests to verify both issues

  • All Unit tests are passing

@perpetualKid perpetualKid merged commit ec63f37 into perpetualKid:main May 17, 2026
1 check passed
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