Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New empty has-rgh element added on turbo frame navigations #6568

Closed
JoshuaKGoldberg opened this issue Apr 25, 2023 · 1 comment · Fixed by #6753
Closed

New empty has-rgh element added on turbo frame navigations #6568

JoshuaKGoldberg opened this issue Apr 25, 2023 · 1 comment · Fixed by #6753
Labels
ajax Temporary label to collect Ajax issues bug meta Related to Refined GitHub itself

Comments

@JoshuaKGoldberg
Copy link

Description

I'm seeing empty <has-rgh></has-rgh> elements getting added inside <main id="js-repo-pjax-container"> on a GitHub issues/PRs page every time I navigate between the two. They're added once per navigation and never removed. Is this some kind of element leak / bug with GH's SPA navigation?

Note that I don't have a Personal Access Token in my options. But I would consider this a bug regardless of PAT status. 😄

Screenshot of over a dozen has-rgh elements alongside turbo-frame in Chrome element inspector dev tools

How to replicate the issue + URL

  1. Visit a repo's Issues page
  2. Click the Pull requests tab
  3. Click the Issues tab
  4. Repeat 2 & 3 a few times

Extension version

23.4.10

Browser(s) used

Chrome on macOS

@fregante fregante added the ajax Temporary label to collect Ajax issues label Apr 25, 2023
@fregante
Copy link
Member

Thanks for the report, we indeed never remove it:

/*
When navigating back and forth in history, GitHub will preserve the DOM changes;
This means that the old features will still be on the page and don't need to re-run.
This marks each as "processed"
*/
void add('rgh-deduplicator' as FeatureID, {
awaitDomReady: true,
async init() {
// `await` kicks it to the next tick, after the other features have checked for 'has-rgh', so they can run once.
await Promise.resolve();
select(_`#js-repo-pjax-container, #js-pjax-container`)?.append(<has-rgh/>);
select(_`turbo-frame`)?.append(<has-rgh-inner/>); // #4567
},
});

Due to recent AJAX issues, we're being extra cautious with avoiding duplicates of actual elements on the page, so you get duplicate hidden elements in your DOM. I'll keep this open to track the general issue but it's not something we will fix before the big ones are figured out:

@fregante fregante added the meta Related to Refined GitHub itself label Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ajax Temporary label to collect Ajax issues bug meta Related to Refined GitHub itself
Development

Successfully merging a pull request may close this issue.

2 participants