diff --git a/SVSim.EmulatedEntrypoint/Services/BattlePassService.cs b/SVSim.EmulatedEntrypoint/Services/BattlePassService.cs index d2ad0c3..15df87c 100644 --- a/SVSim.EmulatedEntrypoint/Services/BattlePassService.cs +++ b/SVSim.EmulatedEntrypoint/Services/BattlePassService.cs @@ -191,8 +191,9 @@ public sealed class BattlePassService : IBattlePassService // op, any grants override the post-state. result.RewardList carries the final // post-state including the deducted crystal balance. result.Deltas carries the raw // grant amounts for achieved_info (no spend entry in Deltas, only GrantOps). + // CommitAsync's SaveChangesAsync flushes the AddClaim rows + the progress.IsPremium + // mutation alongside the inventory grants — all tracked on the same scoped DbContext. var result = await tx.CommitAsync(ct); - await _db.SaveChangesAsync(ct); // flush claim rows added via _viewerBp.AddClaim return new BattlePassBuyOutcome(1, result.Deltas, result.RewardList); } @@ -246,8 +247,12 @@ public sealed class BattlePassService : IBattlePassService var result = await tx.CommitAsync(ct); newlyClaimed = result.Deltas; } - - await _db.SaveChangesAsync(ct); + else + { + // No level crossed → no tx opened → still need to persist the progress mutation + // (CurrentPoint/WeeklyPoints/WeeklyPeriodStart) tracked on the scoped DbContext. + await _db.SaveChangesAsync(ct); + } return new BattlePassPointGrant( BeforePoint: beforePoint,