feat(desktop-client): derive stable client_id from machine identity
Generate the desktop client_id deterministically from OS machine identifiers (IOPlatformUUID / MachineGuid / /etc/machine-id) scoped per tenant+workspace+user, with a persisted UUID fallback when the OS lookup fails. The renderer now requests the id over a new IPC bridge instead of keeping a localStorage UUID, so reinstalls and storage clears no longer fork into duplicate clients. Server enforces the id as required and rejects empty/malformed UUIDs. Also harden bootstrap reveal flow and single-instance exit so a second launch focuses the existing window. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+10
-1
@@ -15,7 +15,16 @@ declare global {
|
||||
desktopBridge: {
|
||||
app: {
|
||||
ping(): Promise<string>;
|
||||
deviceInfo(): Promise<{ device_name: string; os: string; cpu_arch: string }>;
|
||||
deviceInfo(): Promise<{
|
||||
device_name: string;
|
||||
os: string;
|
||||
cpu_arch: string;
|
||||
}>;
|
||||
clientId(scope: {
|
||||
tenant_id: number;
|
||||
workspace_id: number;
|
||||
user_id: number;
|
||||
}): Promise<string>;
|
||||
runtimeSnapshot(): Promise<DesktopRuntimeSnapshot>;
|
||||
bindPublishAccount(platformId: string): Promise<DesktopAccountInfo>;
|
||||
refreshRuntimeAccounts(): Promise<null>;
|
||||
|
||||
Reference in New Issue
Block a user