fix(check): merge anonymous resignup viewer into Steam-linked viewer
GameStart already detects the Steam-vs-UDID mismatch produced by wipe-and-resignup; it now also reclaims the orphan. New ViewerRepository.MergeAnonymousViewerInto transfers the fresh UDID from V_new onto V_old in one save (freeing the unique-index slot), then deletes V_new in a second save. Partial-failure mode is a benign null-UDID viewer; two rows never contend for the same UDID. Side benefit: future GetViewerByUdid lookups now short-circuit to V_old without going through the Steam handler. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,10 @@ public class CheckController : SVSimController
|
||||
if (udidViewer is not null && udidViewer.Id != fullViewer.Id)
|
||||
{
|
||||
rewriteViewerId = fullViewer.Id;
|
||||
// Reclaim the orphan: transfer the fresh UDID onto the Steam-resolved viewer
|
||||
// and delete the just-created blank anonymous one. Future GetViewerByUdid
|
||||
// calls then short-circuit to V_old without going through the Steam handler.
|
||||
await _viewerRepository.MergeAnonymousViewerInto(udidViewer.Id, fullViewer.Id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user