From 3edcd286fd7f8307f59e2930601ae09684497a43 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Mon, 14 Jul 2025 10:57:06 +0700 Subject: [PATCH] update session ID handling in worker communication protocol; allow null session ID to indicate no active session --- worker.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/worker.md b/worker.md index 88ddaf0..f874ff2 100644 --- a/worker.md +++ b/worker.md @@ -257,7 +257,7 @@ Backend's response to a `patchSession` message. ### 5.5. Set Session ID -Allows the backend to instruct the worker to associate a session ID with a subscription. This is useful for linking detection events to a specific session. +Allows the backend to instruct the worker to associate a session ID with a subscription. This is useful for linking detection events to a specific session. The session ID can be `null` to indicate no active session. - **Type:** `setSessionId` @@ -273,8 +273,20 @@ Allows the backend to instruct the worker to associate a session ID with a subsc } ``` +Or to clear the session: + +```json +{ + "type": "setSessionId", + "payload": { + "subscriptionIdentifier": "display-001;cam-002", + "sessionId": null + } +} +``` + > **Note:** -> - The worker should store the session ID for the given subscription and use it in subsequent detection or patch messages as appropriate. +> - The worker should store the session ID for the given subscription and use it in subsequent detection or patch messages as appropriate. If `sessionId` is `null`, the worker should treat the subscription as having no active session. ## 6. Example Communication Log