Skip to content

Features are inited twice #9935

Open
Open

Description

@fregante

Description

Just noticed: all features are inited twice everywhere.

First load:

  1. sync run
  2. soft-nav:react-done

Successive loads

  1. turbo:render
  2. soft-nav:react-done

Caused by:

The fact that we're not suddenly getting duplicate content everywhere shows that our deduplication logic and policy is doing a decent job 🙌

} while (await oneEvent(document, ['turbo:render', 'soft-nav:react-done']));

I think the solution would be to uniquely identify page loads in that loop. I'm not sure if URL-based deduplication is enough, maybe it is. e.g.

if URL === lastURL, skip, else set lastURL = URL

How to replicate the issue + URL

  1. Enable Show the features enabled on each page in the console
  2. filter archive-forks-link since it's enabled on all repo pages
  3. see it appear twice every time

Extension version

26.78.3

Browser(s) used

safari

Token ⚠️

  • I set a token in the options page. I understand that some features require a token to work.

Activity

  1. added
    meta
    on Aug 3, 2026
  2. fregante commented on Aug 3, 2026

    @fregante
    MemberAuthor

    AI PRs and newbies not welcome.

  3. fregante commented on Aug 4, 2026

    @fregante
    MemberAuthor

    We have this code to deduplicate the first load, but it's still probably best to find a more comprehensive solution (and replace this)

    https://github.com/refined-github/refined-github/blob/c10f1d1cc9af912f21984afed6f753183b4d9a89/source/helpers/feature-helpers.ts#L38-L52

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

    acceptedbugmeta

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions