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

'allChatters' is empty if called more often than once per minute #105

Closed
hadmaerd opened this issue Feb 25, 2020 · 2 comments
Closed

'allChatters' is empty if called more often than once per minute #105

hadmaerd opened this issue Feb 25, 2020 · 2 comments
Labels

Comments

@hadmaerd
Copy link

Bug Report

Code

// repeatedly calling this
var chatData = await twitchClient.unsupported.getChatters (channelName);

Expected behavior

chatData.allChatters contains valid actual or cached list of users in the chat

Actual Behavior

chatData.allChatters is empty if it's been less than 1 minute since last query

@d-fischer
Copy link
Member

d-fischer commented Feb 25, 2020

I just checked it with this code:

const twitch = TwitchClient.withClientCredentials(clientId, clientSecret);

(async () => {
	console.log((await twitch.unsupported.getChatters('thijs')).allChatters.length);

	await new Promise(resolve => setTimeout(resolve, 1000));

	console.log((await twitch.unsupported.getChatters('thijs')).allChatters.length);
})();

Both log statements output the same number.

Please provide additional info, like your environment details (which was in the issue template for you to fill...)

@d-fischer
Copy link
Member

After discussion on Discord, it was found that the chatters list was mutated, and that was the problem because the result of ChattersList#allChatters is cached. I removed that cache.

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

No branches or pull requests

2 participants