fix(pack): tutorial pack_open ThenIncludes OwnedItemEntry.Item
Without .ThenInclude(i => i.Item), the OwnedItemEntry.Item nav defaults to a new ItemEntry() with Id=0 (project_ef_nav_include_pitfall), so the FirstOrDefault(i => i.Item.Id == ticketItemId) lookup never matched. The ticket was never decremented and reward_list omitted the post-state entry — on the next /tutorial/pack_info the pack stayed visible and the client re-clicked into plain /pack/open, which 501s on type_detail=5. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -183,7 +183,7 @@ public class PackController : SVSimController
|
||||
var viewer = await _db.Viewers
|
||||
.Include(v => v.PackOpenCounts)
|
||||
.Include(v => v.MissionData)
|
||||
.Include(v => v.Items)
|
||||
.Include(v => v.Items).ThenInclude(i => i.Item)
|
||||
.AsSplitQuery()
|
||||
.FirstAsync(v => v.Id == viewerId);
|
||||
int packNumber = Math.Max(1, request.PackNumber);
|
||||
|
||||
Reference in New Issue
Block a user