fix(guild): emit is_friend / is_friend_apply in /guild/info members

GuildMemberInfo.cs:48-49 re-reads json["is_friend"] / json["is_friend_apply"]
UNGUARDED on top of the base-class UserInfoBase's guarded read. Our DTO had
them as int? with global WhenWritingNull → keys omitted → LitJson threw
KeyNotFoundException, crashing the client right after guild create.

Flip the fields to non-nullable int with JsonIgnoreCondition.Never so they
always ship, and wire a batched IFriendService.GetFriendRelationsAsync
lookup so the values are actually populated (single Contains-batched query
per relation table).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-07-04 16:18:22 -04:00
parent 1bdcd8397b
commit 7a13e99df7
5 changed files with 64 additions and 8 deletions

View File

@@ -27,4 +27,12 @@ public interface IFriendService
/// <summary>Deletes both directions of the friendship (A→B and B→A).</summary>
Task RejectFriendAsync(long viewerId, int targetViewerId, CancellationToken ct);
/// <summary>
/// Batched caller-relative friend-relation lookup. For each id in <paramref name="otherViewerIds"/>
/// returns whether the caller is already friends with them and/or has an outgoing pending apply
/// to them. Self and unknown ids resolve to <c>(false, false)</c>.
/// </summary>
Task<IReadOnlyDictionary<long, FriendRelation>> GetFriendRelationsAsync(
long viewerId, IReadOnlyList<long> otherViewerIds, CancellationToken ct);
}