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:
gamer147
2026-05-28 20:15:31 -04:00
parent b50a884af9
commit ac077dfc13
4 changed files with 74 additions and 1 deletions

View File

@@ -103,6 +103,11 @@ public class TutorialFlowEndToEndTests
Assert.That(await factory.GetViewerTutorialStateAsync(viewerId), Is.EqualTo(100),
"Viewer reaches TUTORIAL_END after the full flow.");
// The gift granted item 90001 count=1 (via /tutorial/gift_receive entry 71478630).
// /tutorial/pack_open consumes it; assert the ticket is gone post-flow.
Assert.That(await factory.GetOwnedItemCountAsync(viewerId, 90001), Is.EqualTo(0),
"Starter legendary ticket must be consumed by /tutorial/pack_open.");
}
private static Task<HttpResponseMessage> Post(HttpClient client, string url, string body)