From 5bf520c46490f5c14bcdf354e52293084634350c Mon Sep 17 00:00:00 2001 From: Wanjohi Date: Wed, 7 Oct 2026 15:43:25 +0000 Subject: [PATCH] Name the run's owner on session.start (#362) Adds `userId` (the box owner) to `session.start` so a host knows whose Steam sign-in plays the run. API tests: 161 pass. --- apps/api/test/session.test.ts | 3 ++- packages/core/src/session/index.ts | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/api/test/session.test.ts b/apps/api/test/session.test.ts index 6d9bc5bd..21c10987 100644 --- a/apps/api/test/session.test.ts +++ b/apps/api/test/session.test.ts @@ -428,7 +428,8 @@ describe('GET /machine/jobs', () => { boxTier: 'sm', gameId: s.gameId, steamAppId: 5520, - linkedAccountId: s.owner.linkedAccountId + linkedAccountId: s.owner.linkedAccountId, + userId: s.owner.userId }); }); diff --git a/packages/core/src/session/index.ts b/packages/core/src/session/index.ts index 76cdf1c7..b43ded13 100644 --- a/packages/core/src/session/index.ts +++ b/packages/core/src/session/index.ts @@ -336,6 +336,11 @@ export namespace Session { linkedAccountId: z.string().meta({ description: 'Which linked account is playing', example: Examples.Session.linkedAccountId + }), + userId: z.string().meta({ + description: + 'Whose run it is: the box owner, whose Steam sign-in on this host plays it', + example: Examples.User.id }) }) .meta({ @@ -413,7 +418,8 @@ export namespace Session { boxTier: row.box.tier as z.infer['boxTier'], gameId: row.game.id, steamAppId: row.game.steamAppId, - linkedAccountId: row.session.linkedAccountId + linkedAccountId: row.session.linkedAccountId, + userId: row.box.userId }) ) );