Skip to content

Fix: Explicitly import Handlebars in translations/index.ts instead of relying on global#3967

Merged
stephenhand merged 2 commits intoCHI-3736-mask_notificationsfrom
copilot/sub-pr-3964
Feb 26, 2026
Merged

Fix: Explicitly import Handlebars in translations/index.ts instead of relying on global#3967
stephenhand merged 2 commits intoCHI-3736-mask_notificationsfrom
copilot/sub-pr-3964

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

lookupTranslation called Handlebars.compile(...) without importing handlebars, relying implicitly on the global injected by the Flex runtime. This caused a fragile dependency and forced tests to manually inject global.Handlebars.

Description

  • translations/index.ts: Added explicit import Handlebars from 'handlebars' — package was already a declared dependency
  • translations/index.test.ts: Removed beforeAll/afterAll blocks that injected/cleaned up global.Handlebars
// Before: implicit global, fragile outside Flex runtime
return Handlebars.compile(strings[code] ?? code)(parameters);

// After: explicit import
import Handlebars from 'handlebars';

Checklist

  • Corresponding issue has been opened
  • New tests added
  • Feature flags added
  • Strings are localized
  • Tested for chat contacts
  • Tested for call contacts

Other Related Issues

None

Verification steps

Run npx jest src/___tests__/translations/index.test.ts in plugin-hrm-form — all 8 tests pass.

AFTER YOU MERGE

  1. Cut a release tag using the Github workflow. Wait for it to complete and notify in the #aselo-deploys Slack channel.
  2. Comment on the ticket with the release tag version AND any additional instructions required to configure an environment to test the changes.
  3. Only then move the ticket into the QA column in JIRA

You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…ing on global

Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP address feedback on CHI-3736: Mask identifiers in notifications Fix: Explicitly import Handlebars in translations/index.ts instead of relying on global Feb 26, 2026
@stephenhand stephenhand marked this pull request as ready for review February 26, 2026 17:50
@stephenhand stephenhand merged commit 40e028f into CHI-3736-mask_notifications Feb 26, 2026
26 checks passed
@stephenhand stephenhand deleted the copilot/sub-pr-3964 branch February 26, 2026 17:50
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