Skip to content

Rapid scrolling through themes causes update depth crash #884

Closed

Description

@winstwan

What happened?

Holding down the scroll button through the theme selector causes too many re-renders and crashes the application, making the terminal unresponsive.

Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React
  limits the number of nested updates to prevent infinite loops.
      at getRootForUpdatedFiber (/$bunfs/root/hunk:76360:131)
      at dispatchSetStateInternal (/$bunfs/root/hunk:77659:45)
      at dispatchSetState (/$bunfs/root/hunk:77630:31)
      at <anonymous> (/$bunfs/root/hunk:118559:26)
      at react_stack_bottom_frame (/$bunfs/root/hunk:82471:26)
      at runWithFiberInDEV (/$bunfs/root/hunk:75119:135)
      at commitHookEffectListMount (/$bunfs/root/hunk:79292:181)
      at commitHookPassiveMountEffects (/$bunfs/root/hunk:79340:83)
      at commitPassiveMountOnFiber (/$bunfs/root/hunk:80306:56)
      at recursivelyTraversePassiveMountEffects (/$bunfs/root/hunk:80294:36)

Steps to reproduce

  1. Open a diff (e.g. hunk show HEAD~1)
  2. Open theme selector, press t
  3. Hold scroll button arrow (e.g. hold j)
  4. After ~20-30 theme changes, crash with the error message shown above.

Expected behavior

Unsolicited Fix Proposal

Add a debounce to the live theme re-render.

Version

0.20.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions