test(user-mypage): explain Clear() + cover unparseable rotation entries

Add a comment above MyPageBgRotation.Clear() explaining the EF OwnsMany
delete-on-clear semantics. Add a 7th test covering garbage/"" entries in
mypage_id_list falling back to BgId=0 while adjacent valid entries are
unaffected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-09 16:50:38 -04:00
parent 9ff6c70faf
commit 6123a64b37
2 changed files with 21 additions and 0 deletions

View File

@@ -32,6 +32,8 @@ public sealed class UserMyPageController : SVSimController
viewer.MyPageBgSelectType = request.SelectType;
viewer.MyPageBgId = ParseIdOrZero(request.MyPageId);
// Clear() on a loaded OwnsMany marks every tracked entry as Deleted; SaveChangesAsync
// issues DELETEs for all old slots before inserting the new ones.
viewer.MyPageBgRotation.Clear();
for (int slot = 0; slot < request.MyPageIdList.Count; slot++)
{