C4: capture native event-send wire that populates Source_Object (CM_EVENT SourceName drop) #3
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The captured
AddS2/ CM_EVENT event-send wire does not carry an event's source, so an ad-hocSendEventlands inRuntime.dbo.EventswithSource_Object = NULL(and the otherSource_*/Provider_*columns null). A source-filtered read of one's own just-sent event thereforereturns 0 rows. This issue tracks the reverse-engineering capture needed to close that.
Current behaviour
src/AVEVA.Historian.Client/Wcf/HistorianEventWriteProtocol.cs→SerializeEventValueBlobserializes,in order: CM_EVENT tag GUID, EventTime FILETIME, OpcQuality ×2, the
0x118Dvalue descriptor, theevent Id GUID, ReceivedTime FILETIME, Namespace, Type, struct-version, then string properties.
It never serializes
evt.SourceName. The wire shape was decoded byte-for-byte from two nativecaptures (
User.WriteandAlarm.Set), and neither capture carried a source field — so there isno evidence for which wire field (if any) maps to
Source_Object.Source_Objectappears to be a Galaxy-platform association the App-Server alarm pipeline sets forobject-raised events, not something the generic CM_EVENT send path carries. That hypothesis is
unproven without a capture.
Root cause
No protocol evidence exists for the source field on the event-send wire. This is not fixable in the
managed client by re-threading the value (the gateway already threads
SourceNamecorrectly all theway to
HistorianProtoMapper.ToSdk; the serializer drops it because no captured byte maps to it).What's needed (reverse-engineering task)
populate
Source_Objectindbo.Events— most likely an object-raised App-Server alarm event,contrasted against the existing
User.Write/Alarm.Setgeneric sends that do not.SerializeEventValueBlobto emit that field,add a golden serializer test, and re-vendor.
document that as the closing finding and keep the managed path honest (no silent NULL source).
Acceptance criteria
docs/reverse-engineering/showing whether/which wire field maps toSource_Object.SerializeEventValueBlobemits the source field + golden test + a liveSendEvent→ source-filteredReadEventsround-trip returning the event, or (b) a documentedwon't-fix with the protocol reason.
References
src/AVEVA.Historian.Client/Wcf/HistorianEventWriteProtocol.cs(SerializeEventValueBlob).pending.mdC4 (closed won't-fix at the gateway pendingthis capture); OtOpcUa follow-up plan FU-1; OtOpcUa live test
Alarm_SendEvent_then_ReadEventsskips with this reason.
#1) — both end at "needs evidence/behaviour not reconstructable from the current client."
https://claude.ai/code/session_012SDSQ3AcaXqPcBtDESBRii
Resolved — via the gateway, no histsdk change needed
A live reverse-engineering probe (2026-06-27) overturned this issue's premise.
Source_Objectisnot a missing wire field — the historian derives it from an ordinary event property named
source_object, the exact inverse of the read parser (HistorianEventRowProtocol.BuildEvent, whichhydrates
SourceNamefromsource_processvariable/source_object). The event-send serializer alreadyserializes string properties; the dedicated
SourceNamefield is the only thing dropped.Live proof (2023 R2 historian). Sending an event with
Properties["source_object"] = <marker>populates
Runtime.dbo.Events.Source_Object = <marker>(reproduced). So a generic CM_EVENT send canpopulate the column after all — the earlier "only the App-Server alarm pipeline sets it" belief was
wrong.
Fix — gateway-side, non-vendored.
HistorianProtoMapper.ToSdknow threads a non-emptySourceNameinto
Properties["source_object"](unless the caller already set that key). Verified by unit tests +a live
SendEvent→ SQL round-trip assertingSource_Object== the sentSourceName. No change tothe vendored serializer and no new native capture was required — the wire was always capable.
Closing as resolved-via-gateway; no upstream
histsdkwork remains. (HistorianGatewaypending.mdC4updated FIXED; unblocks OtOpcUa FU-1.)
https://claude.ai/code/session_012SDSQ3AcaXqPcBtDESBRii