Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug - [GenerateId] - Generates duplicate id sequences if multiple versions of PF are loaded. #10160

Closed
Hyperkid123 opened this issue Mar 13, 2024 · 0 comments · Fixed by #10178
Assignees
Milestone

Comments

@Hyperkid123
Copy link
Contributor

Problem

Components that use the randomly generated IDs can have duplicate IDs, if a multiple versions of PF are loaded into the browser. A typical example is an environment that uses module federation.

How do you reproduce the problem?

Create a module federation environment, with 2 modules that share @patternfly/react-core using different versions so the modules do not meet the version range requirements.

Use some components that use the GenerateId wrapper. There will be duplicate IDs

Expected behavior
Each ID will be unique.

Is this issue blocking you?
Causes some bugs in HCC

Screenshots
image

Possible fixes

  1. Make the sequence global by storing the current sequence value in the globalThis:

  2. Add some random string to the prefix so each module instance has a unique prefix:

    something like pf-random-id-111-

@github-project-automation github-project-automation bot moved this to Needs triage in PatternFly Issues Mar 13, 2024
@tlabaj tlabaj moved this from Needs triage to On deck in PatternFly Issues Mar 15, 2024
@tlabaj tlabaj added this to the Prioritized Backlog milestone Mar 15, 2024
@wise-king-sullyman wise-king-sullyman self-assigned this Mar 18, 2024
@wise-king-sullyman wise-king-sullyman moved this from On deck to Not started in PatternFly Issues Mar 18, 2024
@wise-king-sullyman wise-king-sullyman moved this from Not started to In Progress in PatternFly Issues Mar 18, 2024
@wise-king-sullyman wise-king-sullyman moved this from In Progress to PR Review in PatternFly Issues Mar 18, 2024
@github-project-automation github-project-automation bot moved this from PR Review to Done in PatternFly Issues Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
3 participants