refactor(guild_chat): extract chat-user lookup to viewer repo; fix NEW-direction exclusivity
Add ChatUserProfile record and IViewerRepository.LoadChatProfilesAsync (AsNoTracking, projects Name/EmblemId/CountryCode/Rank/DegreeId from Viewer+Info nav refs). GuildChatController.Messages now injects IViewerRepository instead of SVSimDbContext; calls LoadChatProfilesAsync to populate users[] (removes direct db access from controller). GuildChatMessageRepository direction=2 (NEW): change >= start to > start (exclusive). GuildChatPollTests updated to assert the start message is NOT returned by direction=NEW. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -102,9 +102,9 @@ public sealed class GuildChatMessageRepository : IGuildChatMessageRepository
|
||||
.OrderBy(m => m.MessageId)
|
||||
.ToListAsync(ct);
|
||||
|
||||
case 2: // NEW — messages newer than (and including) start
|
||||
case 2: // NEW: strictly newer than start (exclusive)
|
||||
return await baseQ
|
||||
.Where(m => m.MessageId >= start)
|
||||
.Where(m => m.MessageId > start)
|
||||
.OrderBy(m => m.MessageId)
|
||||
.Take(limit)
|
||||
.ToListAsync(ct);
|
||||
|
||||
Reference in New Issue
Block a user