-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Feat: resharding #3014
base: main
Are you sure you want to change the base?
Feat: resharding #3014
Conversation
BenchmarkDetail results of benchmarks
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3014 +/- ##
==========================================
+ Coverage 76.72% 79.40% +2.68%
==========================================
Files 193 182 -11
Lines 23384 21227 -2157
Branches 763 460 -303
==========================================
- Hits 17941 16856 -1085
+ Misses 5434 4364 -1070
+ Partials 9 7 -2
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
This pull request has gone stale for over a month. If this pull request is still useful, leave a comment below. Otherwise, it will be closed shortly. |
@Skillz4Killz Is there anything missing/not working? |
// TODO: fetch bot gateway info | ||
const sessionInfo = await gateway.resharding.getSessionInfo() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this TODO done yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so? The comment says to get bot gateway info and I think that's what it does since the first commit to this PR 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it though? The code inside getSessionInfo
just throw an error and require the end user to override the handler? I thought resharding is enabled by default and should work out of the box?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it's intended that way because we don't have a way to use rest in gateway right?
// Ignore events until we are ready | ||
events: { | ||
async message(shard, payload) { | ||
if (payload.t === 'READY') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Ignore events until we are ready | |
events: { | |
async message(shard, payload) { | |
if (payload.t === 'READY') { | |
events: { | |
async message(shard, payload) { | |
// Ignore events until we are ready | |
if (payload.t === 'READY') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure if this comment talks about gateway events or the events like messageCreate etc.
// Mark that we are making an identify request so another is not made. | ||
bucket.identifyRequests.push(resolve) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't seem to find any lines checking that "if we are making an identify request, don't make another one" or something like that?
async updateGuildsShardId(guildIds, shardId) { | ||
logger.warn(`[Resharding] Updating the following guild ids shard to #${shardId}: ${guildIds.join(', ')}`) | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhh is this function/method supposed to do something? Why is there only 1 logger.warn
line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we even need this function internally? I feel like this is another function that was supposed to be overrode by the user to update their guilds shard ids if they store it
shard.events.message = async function (_, message) { | ||
// Member checks need to continue but others can stop | ||
if (message.t !== 'GUILD_MEMBERS_CHUNK') return | ||
// Process only the chunking events | ||
oldHandler?.(shard, message) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering if anyone can tell me why "member checks need to continue".
Co-authored-by: LTS20050703 <lts20050703@gmail.com>
No description provided.