refactor(shared): strip cryptographic device provisioning (now telemetry-only)

devices rows no longer carry public_key for crypto purposes. The whole
per-device key API surface (provisionNewDevice, loadDevicePrivateKey,
saveDevicePrivateKey, forgetDevicePrivateKey, restoreDeviceFromServerRecord)
is removed; registerDevice now records {name, platform} only. SQL drops the
NOT NULL on devices.public_key so future telemetry rows can omit it.

Note: SQL not applied locally - push via pnpm prod:migrate when ready.
This commit is contained in:
byGalax
2026-05-15 23:19:26 +02:00
parent 15ef9ece66
commit f7c60945d0
5 changed files with 22 additions and 224 deletions
+7 -5
View File
@@ -77,11 +77,13 @@ export async function listConversationDeviceKeys(
.in('user_id', memberIds);
if (dErr) throw dErr;
return (devices ?? []).map((d) => ({
deviceId: d.id,
userId: d.user_id,
publicKey: pgHexToBytes(d.public_key),
}));
return (devices ?? [])
.filter((d): d is typeof d & { public_key: string } => d.public_key !== null)
.map((d) => ({
deviceId: d.id,
userId: d.user_id,
publicKey: pgHexToBytes(d.public_key),
}));
}
export interface SendMessageParams {