Skip to content

Fix consent managment load#78

Open
lazaki wants to merge 21 commits intomasterfrom
fix-consent-managment-load
Open

Fix consent managment load#78
lazaki wants to merge 21 commits intomasterfrom
fix-consent-managment-load

Conversation

@lazaki
Copy link
Collaborator

@lazaki lazaki commented Mar 20, 2026

Closes #
Fixed consent management locale loading so it no longer defaults to German and now resolves the correct language from app/user locale settings.
Changelog
New

  • Added locale resolution fallback logic for consent management initialization.
    Changed
  • Updated consent management script/config loading to use the detected locale instead of always de. - Improved language mapping/normalization handling for supported locales.

Copy link

Copilot AI left a comment

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 aims to fix consent manager initialization so the correct locale’s consent script is loaded (and re-loaded) rather than ending up with stale/default language behavior, and updates repository automation around registry/lockfile handling.

Changes:

  • Update consent manager loader to de-dupe concurrent requests and remove previously injected consent-manager scripts before injecting the new locale.
  • Adjust root update:registry script (JFrog URL) and remove the “Update npm registry” step from CI.
  • Regenerate/update multiple package package-lock.json files.

Reviewed changes

Copilot reviewed 3 out of 13 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
packages/utils/src/integration/integration.ts Adds request de-duping and script cleanup for consent manager script injection.
.github/workflows/continuous.yml Removes the workflow step that ran npm run update:registry.
package.json Updates the registry replacement URL used by update:registry.
packages/validators/package-lock.json Lockfile updated; notably drops entries for internal deps.
packages/validators-vue/package-lock.json Lockfile updated; notably drops entries for internal deps.
packages/validators-angular/package-lock.json Lockfile updated; notably drops entries for internal deps.
packages/pipes/package-lock.json Lockfile updated; notably drops entries for internal deps.
packages/pipes-vue/package-lock.json Lockfile updated; notably drops entries for internal deps.
packages/pipes-angular/package-lock.json Lockfile updated; notably drops entries for internal deps.
packages/form-vue/package-lock.json Lockfile updated; notably drops entries for internal deps.
packages/utils/package-lock.json Lockfile formatting update (EOF change).
packages/unsupported-browsers/package-lock.json Lockfile updated (metadata/EOF changes).
packages/clean-architecture/package-lock.json Lockfile formatting update (EOF change).
Files not reviewed (8)
  • packages/form-vue/package-lock.json: Language not supported
  • packages/pipes-angular/package-lock.json: Language not supported
  • packages/pipes-vue/package-lock.json: Language not supported
  • packages/pipes/package-lock.json: Language not supported
  • packages/unsupported-browsers/package-lock.json: Language not supported
  • packages/validators-angular/package-lock.json: Language not supported
  • packages/validators-vue/package-lock.json: Language not supported
  • packages/validators/package-lock.json: Language not supported

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

Comment on lines 9 to 13
"version": "3.17.0",
"license": "Apache-2.0",
"dependencies": {
"@baloise/web-app-utils": "^3.17.0",
"date-fns": "^2.28.0",
"lodash.capitalize": "^4.2.1",
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

package-lock.json no longer lists @baloise/web-app-utils under the root package dependencies (and its node_modules/@baloise/web-app-utils entry was removed), but packages/validators/package.json still declares @baloise/web-app-utils as a dependency. This makes the lockfile inconsistent with the manifest and can lead to incorrect installs (e.g., npm ci not installing required runtime deps). Regenerate this lockfile from the package manifest (or revert the dependency removal) so the lock reflects the declared dependencies.

Copilot uses AI. Check for mistakes.
Comment on lines 9 to 13
"version": "3.17.0",
"license": "Apache-2.0",
"dependencies": {
"@baloise/web-app-utils": "^3.17.0",
"lodash.capitalize": "^4.2.1",
"lodash.isarray": "^4.0.0",
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

package-lock.json no longer lists @baloise/web-app-utils under the root package dependencies (and its node_modules/@baloise/web-app-utils entry was removed), but packages/pipes/package.json still declares @baloise/web-app-utils as a dependency. This makes the lockfile inconsistent with the manifest and can lead to incorrect installs. Regenerate this lockfile from the package manifest (or revert the dependency removal) so the lock reflects the declared dependencies.

Copilot uses AI. Check for mistakes.
Comment on lines 9 to 13
"version": "3.17.0",
"license": "Apache-2.0",
"dependencies": {
"@baloise/web-app-validators": "^3.17.0",
"lodash.isarray": "^4.0.0"
},
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

package-lock.json no longer lists @baloise/web-app-validators under the root package dependencies (and the corresponding node_modules/@baloise/web-app-validators entry was removed), but packages/validators-vue/package.json still declares @baloise/web-app-validators as a dependency. This makes the lockfile inconsistent with the manifest and can lead to incorrect installs. Regenerate this lockfile from the package manifest (or revert the dependency removal) so the lock reflects the declared dependencies.

Copilot uses AI. Check for mistakes.
Comment on lines 9 to 13
"version": "3.17.0",
"license": "Apache-2.0",
"dependencies": {
"@baloise/web-app-validators": "^3.17.0",
"tslib": "^2.2.0"
},
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

package-lock.json no longer lists @baloise/web-app-validators under the root package dependencies (and the corresponding node_modules/@baloise/web-app-validators entry was removed), but packages/validators-angular/package.json still declares @baloise/web-app-validators as a dependency. This makes the lockfile inconsistent with the manifest and can lead to incorrect installs. Regenerate this lockfile from the package manifest (or revert the dependency removal) so the lock reflects the declared dependencies.

Copilot uses AI. Check for mistakes.
@@ -8,9 +8,6 @@
"name": "@baloise/web-app-pipes-vue",
"version": "3.17.0",
"license": "Apache-2.0",
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The root package entry in package-lock.json no longer includes the @baloise/web-app-pipes dependency, but packages/pipes-vue/package.json still declares @baloise/web-app-pipes as a dependency. This lockfile/manifest mismatch can lead to incorrect installs. Regenerate this lockfile from the package manifest so the lock reflects the declared dependencies.

Suggested change
"license": "Apache-2.0",
"license": "Apache-2.0",
"dependencies": {
"@baloise/web-app-pipes": "^3.17.0"
},

Copilot uses AI. Check for mistakes.
Comment on lines 9 to 13
"version": "3.17.0",
"license": "Apache-2.0",
"dependencies": {
"@baloise/web-app-pipes": "^3.17.0",
"tslib": "^2.2.0"
},
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

package-lock.json no longer lists @baloise/web-app-pipes under the root package dependencies (and the corresponding node_modules/@baloise/web-app-pipes entry was removed), but packages/pipes-angular/package.json still declares @baloise/web-app-pipes as a dependency. This makes the lockfile inconsistent with the manifest and can lead to incorrect installs. Regenerate this lockfile from the package manifest (or revert the dependency removal) so the lock reflects the declared dependencies.

Copilot uses AI. Check for mistakes.
"@baloise/web-app-validators": "^3.17.0"
},
"devDependencies": {
"@baloise/design-system-components": "^10.12.0",
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The root package entry in package-lock.json no longer includes the @baloise/web-app-validators dependency, but packages/form-vue/package.json still declares @baloise/web-app-validators as a dependency. This lockfile/manifest mismatch can lead to incorrect installs. Regenerate this lockfile from the package manifest so the lock reflects the declared dependencies.

Suggested change
"@baloise/design-system-components": "^10.12.0",
"@baloise/design-system-components": "^10.12.0",
"@baloise/web-app-validators": "^3.17.0",

Copilot uses AI. Check for mistakes.
Comment on lines 7 to +15
export const loadConsentManagerBaloiseSwitzerland = (lang?: Language): Promise<void> => {
return loadConsentManager().then((cmsData: ConsentManagerData[]) => {
const effectiveLang = LanguagesOfSwitzerland.valueOfOrDefault(lang ? lang.key : undefined)
const requestId = ++activeConsentManagerRequestId

return loadConsentManager(effectiveLang).then((cmsData: ConsentManagerData[]) => {
if (requestId !== activeConsentManagerRequestId) {
return
}

Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

New behavior here (request de-duping via activeConsentManagerRequestId and cleanup of previously injected consent-manager scripts) is not covered by tests. Given this package already uses Jest specs (e.g. app-integration.spec.ts), it would be good to add unit tests that mock fetch and document.head to verify (1) older in-flight requests don’t inject scripts and (2) previously injected scripts are removed before injecting a new locale.

Copilot uses AI. Check for mistakes.
@nobilo nobilo self-assigned this Mar 23, 2026
const removeInjectedConsentManagerScripts = (): void => {
const scripts = document.querySelectorAll(`script[${CONSENT_MANAGER_SCRIPT_ATTRIBUTE}="true"]`)
scripts.forEach(script => script.parentNode?.removeChild(script))
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

works?

@lazaki lazaki requested review from baengel and svene March 23, 2026 15:02
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.

4 participants