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

Parent channel of thread has no thread manager #10563

Open
Glazelf opened this issue Oct 17, 2024 · 2 comments
Open

Parent channel of thread has no thread manager #10563

Glazelf opened this issue Oct 17, 2024 · 2 comments

Comments

@Glazelf
Copy link

Glazelf commented Oct 17, 2024

Which package is this bug report for?

discord.js

Issue description

Bot "randomly" (not during boot cycle) crashes with error below:
Schermafbeelding 2024-10-17 130011

Seems to be an issue with thread parent checks or something. I talked to @almostSouji about this problem here, for some context.

Note (souji):
The issue is not reproduceable on reboot and happened only once during normal operation.

Code sample

No response

Versions

  • discord.js 14.16.3

Issue priority

Low (slightly annoying)

Which partials do you have configured?

User, Channel, GuildMember, Message, Reaction

Which gateway intents are you subscribing to?

Guilds, GuildMembers, GuildModeration, GuildMessages, GuildMessageReactions, DirectMessages, MessageContent

I have tested this issue on a development release

No response

@almostSouji
Copy link
Member

almostSouji commented Oct 17, 2024

Seems to come from here:

case ChannelType.AnnouncementThread:
case ChannelType.PublicThread:
case ChannelType.PrivateThread: {
channel = new (getThreadChannel())(guild, data, client);
if (!allowUnknownGuild) channel.parent?.threads.cache.set(channel.id, channel);
break;

Which would imply a channel that does not have .threads (or another value) is being set as a parent (since the .parent seems to exist) at some point in time.

Potential causes could be a corrupted cache or a private thread being created on a somewhat rare channel type, which we have not considered yet.

@almostSouji
Copy link
Member

Looking at the partials, could this potentially be caused by the parent being partial?
So we receive the partial parent and populate the cache with it; then the thread is being constructed and the partial parent does not have the .threads?

@almostSouji almostSouji changed the title Thread parent check Parent channel of private thread has no thread manager Oct 17, 2024
@almostSouji almostSouji changed the title Parent channel of private thread has no thread manager Parent channel of thread has no thread manager Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants