update session ID handling in worker communication protocol; allow null session ID to indicate no active session
Some checks failed
Build Backend Application and Docker Image / build-docker (push) Has been cancelled

This commit is contained in:
Siwat Sirichai 2025-07-14 10:57:06 +07:00
parent 8f32de1510
commit 3edcd286fd

View file

@ -257,7 +257,7 @@ Backend's response to a `patchSession` message.
### 5.5. Set Session ID ### 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` - **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:** > **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 ## 6. Example Communication Log