Skip to content

chore: Clean up buggy useEffect calls #13422

Closed
@aslilac

Description

@aslilac

Did a quick scan for our current useEffect calls, and a couple of concerns jumped out at me. To be clear, I don't know if these should block enabling StrictMode. These are bugs that our tests aren't catching, but the point of StrictMode is to highlight that these bugs exist. The issues still exist for the end user, whether we're using StrictMode or not

  • useProxyLatency
    • Doesn't clean up its PerformanceObserver
    • Didn't read through the whole file, but my understanding is that each time the effect re-fires, we'll get a new observer that will keep updating state that we don't care about anymore
  • MonacoEditor
    • Not sure if we want to cancel remeasuring the fonts when the theme changes
  • TemplateVersionEditorPage
    • The TAR reader has a race condition when the data changes
      • Initialize the file tree for data 1 and kick off an async process for reading it
      • Data changes and kicks off a new effect, and we now do the same thing for data 2
      • Data 2 finishes reading and updates state first because it's shorter
      • Data 1 then finishes and updates state as well, writing stale data
  • WorkspaceBuildProgress
    • Doesn't clear out a timeout

Originally posted by @Parkreiner in #13399 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    siteArea: frontend dashboard

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions