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

Fix missing server_id during member normalization in GuildMemberAddPacket #201

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

ThibaultPointurier
Copy link
Collaborator

Problem

When a new member is added to a server (during the GuildMemberAddPacket event), the server_id was not being included in the member normalization process. This led to potential errors or inconsistencies during member serialization, particularly when updating the server cache or processing member-related operations.

This issue was confirmed by the following error (see screenshot for reference):
image

Solution

This pull request addresses the issue by explicitly including the server_id in the member normalization data. This ensures that the member is properly linked to the correct server, and all subsequent operations, such as updating the server cache or dispatching events, can proceed as expected.

The change was implemented by modifying the listen method in the GuildMemberAddPacket class:

final rawMember = await marshaller.serializers.member.normalize({
  'server_id': server.id,
  ...message.payload
});

Changes

Added server_id to the payload during member normalization in GuildMemberAddPacket.

Impact

This fix improves the reliability of member-related events and ensures that the member data is handled properly within the server context. It eliminates errors caused by missing server_id during member processing.

@LeadcodeDev LeadcodeDev merged commit 52995f5 into mineral-dart:develop Sep 11, 2024
@LeadcodeDev LeadcodeDev deleted the develop branch September 11, 2024 15:30
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

Successfully merging this pull request may close these issues.

2 participants