review(bp): doc fixes + sales_period_info non-nullable + drop checked cast + TODO

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-05-27 00:00:24 -04:00
parent 9147ab0ec7
commit c7dfd43daa
4 changed files with 18 additions and 5 deletions

View File

@@ -25,7 +25,12 @@ public class BattlePassController : SVSimController
if (!TryGetViewerId(out long viewerId)) return Unauthorized();
var info = await _battlePass.GetInfoAsync(viewerId, ct);
if (info is null) return Ok(new { }); // off-season: empty payload
// TODO(off-season-crash): Empty {} body crashes BattlePassInfoTask.Parse() on the
// client (unconditional jsonData["season_info"] access). Unreachable in practice —
// season 23 outlasts the Cygames shutdown. If a season-24+ ever lands, set
// data_headers.result_code != 1 here so base.Parse() short-circuits before the
// subclass Parse runs.
if (info is null) return Ok(new { });
return Ok(info);
}
@@ -35,6 +40,11 @@ public class BattlePassController : SVSimController
if (!TryGetViewerId(out long viewerId)) return Unauthorized();
var list = await _battlePass.GetItemListAsync(viewerId, ct);
// TODO(off-season-crash): Empty {} body crashes BattlePassPurchaseInfoTask.Parse() on the
// client (unconditional jsonData["premium_pass_description"] access). Unreachable in
// practice — season 23 outlasts the Cygames shutdown. If a season-24+ ever lands, set
// data_headers.result_code != 1 here so base.Parse() short-circuits before the
// subclass Parse runs.
if (list is null) return Ok(new { });
return Ok(list);
}