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

Nicklist re-renders on unrelated user changes #11

Open
prawnsalad opened this issue Feb 13, 2021 · 5 comments
Open

Nicklist re-renders on unrelated user changes #11

prawnsalad opened this issue Feb 13, 2021 · 5 comments

Comments

@prawnsalad
Copy link
Member

When this re-render happens it freezes up the UI for a moment which gets ugly. This happens with the latest master with the user.getColour() call in place
image

@prawnsalad
Copy link
Member Author

More digging and I don't think it's actually the nicklist re-rendering everything. I have #freenode open (1675 users) and every time an unrelated user object changes only 4 user components are re-rendered. However these 4 users are not displayed on screen so I'm not sure why they're getting re-rendered.

image

@prawnsalad
Copy link
Member Author

Interestingly the users it renders are the next 4 users off-screen further down the list. This is while the app is just sat there, no scrolling happening or anything. Not really sure why it would be doing this.

@prawnsalad
Copy link
Member Author

prawnsalad commented Feb 14, 2021

I'm not sure if this is something were doing or a bug in ns-vue but this could posisbly look like a leak of some kind?

I created a quick helper function that lists all vue instances that depends on an instance (below). I took one of the nicks that kept getting re-rendered in the nicklist (u), switched back to the StateBrowser page, and run the user through the helper function. It shows that there is still an AwayStatusIndicator component lay around watching for changes on that user instance - despite no AwayStatusIndicator being on the statebrowser page. This component also has no parent (it's null) so it's definitely not hiding somewhere off screen.

Or perhaps I'm missing something on how this is expected to run?

image

function getDeps(o) {
    let deps = [];
    o.__ob__.dep.subs.forEach(sub => {
        let node = sub.vm.$vnode;
        deps.push(node ? node.tag : sub.expression);
    });
    return deps;
}

@tralves
Copy link
Contributor

tralves commented Feb 15, 2021

only 4 user components are re-rendered. However these 4 users are not displayed on screen

Could these users be being rendered in the message list? There are AwayStatusIndicators there too.

The AwayStatusIndicator is use in the state browser, nick list, and message list. It's not a functional component. Probably something is causing this component to stay in memory. I also, I think that those dependencies all point to the same component instance. I think the -2- is like a component id.

Digging

@prawnsalad
Copy link
Member Author

@tralves right, the references to the same component (-2- as you say) are the watchers in the single component - the computed values and the template itself. So in this example posted it's just this single instance floating around somewhere. It's definitely not in the statebrowser, nicklist or or message list either as it's parent is null and I had visually checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants