Skip to content

feat(core): Sprocket-primary platform identity (issue #727)#737

Draft
gankoji wants to merge 1 commit intomainfrom
cursor/issue-727-sprocket-player-identity-e188
Draft

feat(core): Sprocket-primary platform identity (issue #727)#737
gankoji wants to merge 1 commit intomainfrom
cursor/issue-727-sprocket-player-identity-e188

Conversation

@gankoji
Copy link
Copy Markdown
Member

@gankoji gankoji commented Apr 13, 2026

Summary

Implements GitHub issue #727: treat sprocket.member_platform_account (and Discord auth on User) as the source of truth for platform account linkage, with mledb.player_account as an explicit, temporary mirror during cutover.

Changes

  • MledbPlayerService: getSprocketUserByPlatformInformation, getSprocketPlayerByPlatformInformation, and getPlayerByPlatformId resolve the user via Sprocket MemberPlatformAccount first. If only legacy data exists, they read mledb.player_account + Discord crosswalk and best-effort backfill the Sprocket row for the default-org member.
  • Discord OAuth (discord.strategy): Returning users with Discord linked in Sprocket no longer require a row in mledb.player. New account import still requires MLEDB until full cutover. Legacy mledb.player_account rows are synced into Sprocket with upsertMemberPlatformAccount (idempotent).
  • PlayerService.intakeUser: optional accountSteamIds on CreatePlayerTuple writes Steam links to Sprocket and mirrors to mledb.player_account when an MLE_Player bridge exists (Rocket League / game id 7 only).
  • MemberFixService: after relinking MemberPlatformAccount, re-upserts the legacy mledb.player_account row when the platform code maps to MLE_Platform.
  • DB: migration drops player_account_tracker_unique on mledb.player_account (multiple rows could share empty/null trackers during Sprocket-primary mirroring). Entity index annotation aligned.
  • MledbPlayerAccountService: JSDoc documents what is mirrored and a removal plan for mledb.player_account writes.

Proof

  • npm run build --workspace=core (passes).
  • npm run test --workspace=core for player.service.spec was not run here: Jest fails in this environment without secrets (e.g. REDIS_PASSWORD).

Follow-ups (not in this PR)

  • Extend intake / reporting for XBOX / PS4 / EPIC the same way as Steam if those paths must be fully Sprocket-only without legacy reads.
  • After consumers read only Sprocket, remove createOrUpdatePlayerAccount calls and eventually stop writing mledb.player_account entirely.
Open in Web Open in Cursor 

- Resolve platform accounts via member_platform_account first; backfill from
  mledb.player_account during cutover
- Discord OAuth: returning users no longer require mledb.player; sync legacy
  accounts with upsert
- Intake: optional Steam IDs on CreatePlayerTuple; write to Sprocket and mirror
  to mledb when MLE_Player bridge exists
- Member relink: re-upsert mledb.player_account after Sprocket update
- Drop unique tracker index on mledb.player_account (migration + entity)
- Document legacy mirror and removal plan on MledbPlayerAccountService

Co-authored-by: Jake Bailey <asaxplayinghorse@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants