Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.

Conversation

@DarkRRb
Copy link
Collaborator

@DarkRRb DarkRRb commented May 6, 2025

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request addresses serialization issues with ForwardEntity by updating conversion operators and expanding the MessagePack resolver support. Key changes include reordering resolver arguments in MessageRecord, adding nullable implicit operators for MessageChain in MessageRecord, and introducing a new MessageChainFormatter along with corresponding resolver updates.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Lagrange.OneBot/Database/MessageRecord.cs Updated implicit conversion operators to handle nullable types and revised resolver configuration.
Lagrange.OneBot/Database/MessageEntityResolver.cs Renamed formatter variable and added a formatter for MessageChain serialization.
Lagrange.OneBot/Database/MessageChainFormatter.cs Introduced a new formatter to enable MessageChain serialization via conversion through MessageRecord.
Comments suppressed due to low confidence (1)

Lagrange.OneBot/Database/MessageEntityResolver.cs:17

  • Ensure that there are corresponding tests covering the new CHAIN_FORMATTER to verify proper serialization and deserialization of MessageChain.
if (typeof(T) == typeof(MessageChain)) return (IMessagePackFormatter<T>)CHAIN_FORMATTER;

{
return ((ushort)seq << 16) | (ushort)msgId;
}

Copy link

Copilot AI May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding an inline comment to explain the null-handling behavior in the implicit conversion operator for clarity.

Suggested change
// Converts a nullable MessageChain to a nullable MessageRecord.
// Returns null if the input chain is null; otherwise, creates a new MessageRecord.

Copilot uses AI. Check for mistakes.
@DarkRRb DarkRRb merged commit 225e1f0 into master May 6, 2025
8 checks passed
@DarkRRb DarkRRb deleted the darkrrb/fix/ForwardEntity-cannot-be-serialized branch May 6, 2025 17:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants