attempt to fix deviceid create account bug

This commit is contained in:
Devin Zuczek
2026-07-13 18:53:27 -04:00
parent 92f5b49879
commit 6845c9fd34
3 changed files with 9 additions and 54 deletions
-15
View File
@@ -55,12 +55,6 @@ export interface Account {
phone?: string
/** Set via PUT /account/me/bio; read back via GET /account/:id/bio. */
bio?: string
/**
* Hardware/install id the client last reported (POST /api/PlayerReporting/v1/deviceId).
* The client rotates it — it posts the id it believes we hold plus the new one —
* so this is simply the most recent value it told us about, not a proven identity.
*/
deviceId?: string
/** Remaining username changes; decremented by PUT /account/me/username. */
availableUsernameChanges?: number
/**
@@ -217,15 +211,6 @@ export async function setLastLoginTime(db: D1Database, id: number, time: string)
.run()
}
/** Record the device id the client last reported. False when no such account exists. */
export async function setDeviceId(db: D1Database, id: number, deviceId: string): Promise<boolean> {
const { meta } = await db
.prepare("UPDATE account SET data = json_set(data, '$.deviceId', ?2) WHERE account_id = ?1")
.bind(id, deviceId)
.run()
return meta.changes > 0
}
/** Look up multiple accounts by AccountId (order not guaranteed). */
export async function getAccountsByIds(db: D1Database, ids: number[]): Promise<Account[]> {
if (ids.length === 0) return []