repo(viewer): restore dropped rationale comment, add link-idempotency assertion
Review polish on the prior commit (30874c6):
- BuildDefaultViewer extract dropped the "filter out Id=0 placeholders
and dedupe" comment from the leader-skin grant block — restored.
- LinkSteamToViewer test now calls link twice and asserts count stays
at 1, exercising the alreadyLinked short-circuit.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -170,6 +170,8 @@ public class ViewerRepository : IViewerRepository
|
||||
if (defaultEmblem is not null) viewer.Emblems.Add(defaultEmblem);
|
||||
if (defaultBg is not null) viewer.MyPageBackgrounds.Add(defaultBg);
|
||||
|
||||
// Grant one of each class's default leader skin. Filter out the synthetic placeholders
|
||||
// (Id=0) and dedupe — skins are many-to-many via SleeveEntryViewer-style join.
|
||||
var grantedSkins = viewer.Classes
|
||||
.Select(vcd => vcd.LeaderSkin)
|
||||
.Where(s => s.Id != 0)
|
||||
|
||||
Reference in New Issue
Block a user