Skip to content

Content update on React navigation #9893

Description

@fregante

This issue is about two related bugs:

  • observe remains active on views where it shouldn't run (example)
  • components Svelte remain in memory and still listening to events like URL changes

Svelte component issue

When I mount() components the first time and then they're removed by GitHub, they're still in memory but dormant, potentially garbage collected if we're lucky.

However with self-updating components, they continue to self-update even when not attached to the document.

Repro

  1. Open https://github.com/refined-github/refined-github/blob/main/source/features/action-pr-link.tsx
  2. Click on the "Features" folder
  3. Click on another feature in the sidebar

the previous component is still updated in memory even if rendered nowhere. This specifically happens because GitHub is removing the first one, so observe will mount a new one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    metaRelated to Refined GitHub itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions