Skip to content

UI: Fix infinite hook call causing browsers to freeze#24291

Merged
shilman merged 1 commit intonextfrom
yann/fix-infinite-effect-call
Sep 24, 2023
Merged

UI: Fix infinite hook call causing browsers to freeze#24291
shilman merged 1 commit intonextfrom
yann/fix-infinite-effect-call

Conversation

@yannbf
Copy link
Member

@yannbf yannbf commented Sep 24, 2023

Closes #24275

What I did

Added a missing dependency to a useEffect hook which, by declaring no dependencies, was getting called infinitely. Thank you so much for spotting this out @eneaaliko0, you're the best!

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

I was able to reproduce the issue in Mealdrop, and tested by getting the compiled output of the monorepo and pasting into Mealdrop's node_modules.

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This pull request has been released as version 0.0.0-pr-24291-sha-4df967a3. Install it by pinning all your Storybook dependencies to that version.

More information
Published version 0.0.0-pr-24291-sha-4df967a3
Triggered by @yannbf
Repository storybookjs/storybook
Branch yann/fix-infinite-effect-call
Commit 4df967a3
Datetime Sun Sep 24 16:39:09 UTC 2023 (1695573549)
Workflow run 6291224280

To request a new release of this pull request, mention the @storybookjs/core team.

core team members can create a new canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=24291

@yannbf yannbf added bug ui patch:yes Bugfix & documentation PR that need to be picked to main branch ci:normal labels Sep 24, 2023
@yannbf yannbf force-pushed the yann/fix-infinite-effect-call branch 2 times, most recently from 0c783b7 to 4df967a Compare September 24, 2023 16:20
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

Lgtm but there are some other dependencies in there, should they be added as well? Why is the linting not picking this up?

Can we get a test that would have shown the bug?

this was causing browsers to crash
@yannbf yannbf force-pushed the yann/fix-infinite-effect-call branch from 4df967a to 09c793b Compare September 24, 2023 17:32
@shilman shilman merged commit bf3c377 into next Sep 24, 2023
@shilman shilman deleted the yann/fix-infinite-effect-call branch September 24, 2023 17:55
@github-actions github-actions bot mentioned this pull request Sep 24, 2023
20 tasks
storybook-bot pushed a commit that referenced this pull request Sep 24, 2023
UI: Fix infinite hook call causing browsers to freeze
(cherry picked from commit bf3c377)
@github-actions github-actions bot mentioned this pull request Sep 24, 2023
3 tasks
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Sep 24, 2023
@ndelangen ndelangen removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Oct 28, 2025
@ndelangen ndelangen removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug ci:normal patch:done Patch/release PRs already cherry-picked to main/release branch ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: After upgrade to Storybook 7.4.4 has bug, browser blocked

5 participants