From 7f880d4edda3291cdff27a2033efe3ad1cbfb835 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 25 Aug 2026 16:15:18 -0700 Subject: Issue #6184: Include the script id when it can be determined. Mark it as optional in the doc. --- doc/external-editor-json-rpc.md | 9 +++++---- indra/newview/llscripteditorws.cpp | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/external-editor-json-rpc.md b/doc/external-editor-json-rpc.md index 8b69c80fff..f2bebd0f48 100644 --- a/doc/external-editor-json-rpc.md +++ b/doc/external-editor-json-rpc.md @@ -779,7 +779,7 @@ Debug message notification sent by the viewer during script execution. ```typescript interface RuntimeDebug { - script_id: string; // Not currently sent — see note below + script_id?: string; // Present when the viewer can resolve a script subscription id object_id: string; prim_id: string; item_id: string; @@ -809,7 +809,7 @@ Runtime error notification sent by the viewer when a script encounters an error ```typescript interface RuntimeError { - script_id: string; // Not currently sent — see note below + script_id?: string; // Present when the viewer can resolve a script subscription id object_id: string; prim_id: string; item_id: string; @@ -852,8 +852,9 @@ interface ItemRef { - `name`: Script name as it appears in the prim's inventory. - `language`: The script's source language. Independent of the compile target; the VM is not carried in runtime messages. -**Note on `script_id`:** this field is part of the contract but is **not currently sent** by the -viewer for either `runtime.debug` or `runtime.error`. Implementation is tracked separately. +**Note on `script_id`:** this field is optional. It is included when the viewer can resolve the +originating script inventory item and construct a subscription id from `prim_id` + `item_id`. +When that resolution is not possible, the field is omitted. **Delivery:** `runtime.debug` and `runtime.error` are broadcast to all connections. An event is emitted when the originating object is published or its script is subscribed. diff --git a/indra/newview/llscripteditorws.cpp b/indra/newview/llscripteditorws.cpp index 01f0e60a49..9d309af912 100644 --- a/indra/newview/llscripteditorws.cpp +++ b/indra/newview/llscripteditorws.cpp @@ -2082,6 +2082,10 @@ void LLScriptEditorWSServer::sendRuntimeEvent( } LLSD message; + if (!script_id.empty()) + { + message["script_id"] = script_id; + } message["object_id"] = event.mRootID; message["prim_id"] = event.mPrimID; message["item_id"] = event.mItemID; -- cgit v1.3