From cdb1d2f41e1bd76d9d7ac68f938a76c1fcd55d54 Mon Sep 17 00:00:00 2001 From: Rolands Date: Sat, 3 Jan 2026 15:44:44 +0200 Subject: [PATCH] gen_prop_name receives caller client --- core/core-server.ts | 2 +- core/package-lock.json | 4 ++-- core/package.json | 2 +- core/types.d.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/core-server.ts b/core/core-server.ts index 7610e54..e6fd698 100644 --- a/core/core-server.ts +++ b/core/core-server.ts @@ -467,7 +467,7 @@ export class SocioServer extends LogHandler { } // if a name hasnt been supplied, then generate a unique prop name and return it if (!(data as S_PROP_REG_data)?.prop) { - (data as S_PROP_REG_data).prop = this.lifecycle_hooks.gen_prop_name ? await this.lifecycle_hooks.gen_prop_name() : UUID(); + (data as S_PROP_REG_data).prop = this.lifecycle_hooks.gen_prop_name ? await this.lifecycle_hooks.gen_prop_name(client) : UUID(); while (this.#props.has((data as S_PROP_REG_data).prop as PropKey)) (data as S_PROP_REG_data).prop = UUID(); } diff --git a/core/package-lock.json b/core/package-lock.json index 9420076..ae4450c 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -1,12 +1,12 @@ { "name": "socio", - "version": "1.15.2", + "version": "1.15.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "socio", - "version": "1.15.2", + "version": "1.15.3", "license": "MIT", "dependencies": { "@msgpack/msgpack": "^3.1.2", diff --git a/core/package.json b/core/package.json index 6df7365..de5b14f 100644 --- a/core/package.json +++ b/core/package.json @@ -1,6 +1,6 @@ { "name": "socio", - "version": "1.15.2", + "version": "1.15.3", "description": "A WebSocket Real-Time Communication (RTC) API framework.", "main": "./dist/core.js", "type": "module", diff --git a/core/types.d.ts b/core/types.d.ts index a309f85..80f04ea 100644 --- a/core/types.d.ts +++ b/core/types.d.ts @@ -45,7 +45,7 @@ type ServerHookDefinitions = { file_upload?: (caller_client: SocioSession, files?: SocioFiles, data?: any) => Bit | boolean | Promise, file_download?: (caller_client: SocioSession, data: any) => FS_Util_Response | Promise, endpoint?: (caller_client: SocioSession, endpoint: string) => string | Promise, - gen_prop_name?: () => string | Promise, + gen_prop_name?: (caller_client: SocioSession) => string | Promise, identify?: (caller_client: SocioSession, name: string) => Promise, discovery?: (caller_client: SocioSession, data: MessageDataObj) => Promise<{ [client_id: string]: { name?: string, ip: string, [key: string]: any } } | any>, rpc?: (target_client: ClientID | string | null, f_name: string, args: any[]) => Promise | any,