R1.11 DelTep capture + R1.3/R1.4/R1.12/R1.13 bounded out
DelTep (extended-property delete) — wire format captured + serializer golden-proven, but live delete is server-blocked and NOT exposed publicly: - Captured the DelTep inBuff via a cross-session trick (harness add-tep gains --tep-skip-add + read-for-sync before --tep-delete; Capture-DeleteTagExtended Properties.ps1 / decode-del-tep-capture.py). Layout = same group framing as AddTEx but property-name-only (no 0x43 value) + 0x00 group trailer. - SerializeDeleteRequest + 4 golden tests pin the server-accepted buffer. - A decisive experiment shows SDK-added properties ARE deletable (the native client read-syncs and deletes one), so SDK-add is complete; the SDK's own DelTep is rejected by CHistStorage::DeleteTagExtendedProperties even with byte-identical inBuff, matching mode/handle, GetTgByNm+GetTepByNm prime, open channel, and 60s retries. Root cause: the native multiplexes services over one connection (per-connection working set); the SDK's per-service WCF channels don't reproduce it. Kept as documented-but-blocked internal orchestrator path; no public HistorianClient delete API. Bounded out with evidence (no code; docs + roadmap + probe): - R1.12 localized-property write — no op on 2020 (mirror of R1.6); no *LocalizedPropert*/TagLocalized* symbol in any current/*.dll. - R1.13 non-analog tag create — GATED; native AddTag rejects every non-analog type client-side (ValidationFailed, before any WCF op): SingleByteString, DoubleByteString, Int1 all fail, Float works. No Discrete type in the native enum, no TagType setter. No wire request to capture. - R1.3 timezone + R1.4 EventStorageMode — re-confirmed 2023R2/gRPC-only from the Runtime DB schema (no timezone param, no EventStorageMode anywhere) and a parameter-op probe (GetSystemParameter + GETRP return null/throw for every candidate; only HistorianVersion works). 238 unit tests pass; full solution builds with 0 warnings. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B6mcaT2PjRFKcogzp9UkfC
This commit is contained in:
@@ -390,27 +390,67 @@ internal static class Program
|
||||
groupType.GetMethod("Add", new[] { propType })!.Invoke(group, [prop]);
|
||||
listType.GetMethod("Add", new[] { groupType })!.Invoke(list, [group]);
|
||||
|
||||
MethodInfo addTepMethod = accessType.GetMethods()
|
||||
.First(m => m.Name == "AddTagExtendedProperties" && m.GetParameters().Length == 2);
|
||||
object addTepError = Activator.CreateInstance(errorType)!;
|
||||
object?[] addTepArgs = [list, addTepError];
|
||||
WriteRuntimeMethodPointerSnapshot(assembly, runtimeMethodPointerOutput, runtimeMethodPointerFilters, repoRoot, scenario, "before-add-tep");
|
||||
bool addTepOk = false;
|
||||
string? addTepEx = null;
|
||||
try { addTepOk = (bool)addTepMethod.Invoke(access, addTepArgs)!; }
|
||||
catch (TargetInvocationException ex) { addTepEx = FormatException(ex.InnerException ?? ex); }
|
||||
tepRows.Add(new
|
||||
// 2b) Add the property (AddTEx) unless --tep-skip-add. Skipped in the second
|
||||
// (delete) session so the local cache isn't re-seeded with an UNSYNCED entry —
|
||||
// DeleteTagExtendedPropertiesByName returns err 229 against unsynced properties.
|
||||
if (!HasFlag(args, "--tep-skip-add"))
|
||||
{
|
||||
Kind = "AddTagExtendedProperties",
|
||||
Success = addTepOk,
|
||||
Exception = addTepEx,
|
||||
ErrorDescription = GetPropertyText(addTepArgs[1]!, "ErrorDescription"),
|
||||
ErrorCode = GetPropertyText(addTepArgs[1]!, "ErrorCode"),
|
||||
});
|
||||
MethodInfo addTepMethod = accessType.GetMethods()
|
||||
.First(m => m.Name == "AddTagExtendedProperties" && m.GetParameters().Length == 2);
|
||||
object addTepError = Activator.CreateInstance(errorType)!;
|
||||
object?[] addTepArgs = [list, addTepError];
|
||||
WriteRuntimeMethodPointerSnapshot(assembly, runtimeMethodPointerOutput, runtimeMethodPointerFilters, repoRoot, scenario, "before-add-tep");
|
||||
bool addTepOk = false;
|
||||
string? addTepEx = null;
|
||||
try { addTepOk = (bool)addTepMethod.Invoke(access, addTepArgs)!; }
|
||||
catch (TargetInvocationException ex) { addTepEx = FormatException(ex.InnerException ?? ex); }
|
||||
tepRows.Add(new
|
||||
{
|
||||
Kind = "AddTagExtendedProperties",
|
||||
Success = addTepOk,
|
||||
Exception = addTepEx,
|
||||
ErrorDescription = GetPropertyText(addTepArgs[1]!, "ErrorDescription"),
|
||||
ErrorCode = GetPropertyText(addTepArgs[1]!, "ErrorCode"),
|
||||
});
|
||||
}
|
||||
|
||||
// 3) Optional delete (DelTep) to capture its inBuff too.
|
||||
// 3) Optional delete (DelTep) to capture its inBuff too. The native
|
||||
// DeleteTagExtendedPropertiesByName performs a CLIENT-SIDE sync check and rejects
|
||||
// (err 229) any property the local cache doesn't see as server-synchronized — so a
|
||||
// just-added property can't be deleted in the same session. To capture DelTep:
|
||||
// Run A: add-tep --tep-tag RetestSdkWriteDelTepSdk --tep-name P --tep-value V
|
||||
// Run B: add-tep --tep-tag RetestSdkWriteDelTepSdk --tep-name P \
|
||||
// --tep-skip-create --tep-skip-add --tep-delete
|
||||
// Run B opens a FRESH connection, then we fetch the property from the server
|
||||
// (GetTagExtendedPropertiesByName, fetchFromServer=true) to seed the local cache as
|
||||
// SYNCED before deleting — which lets DeleteTagExtendedPropertiesByName reach the wire.
|
||||
if (HasFlag(args, "--tep-delete"))
|
||||
{
|
||||
// Seed the synced local cache: prime tag identity + force a server fetch.
|
||||
MethodInfo? primeForDelete = accessType.GetMethods()
|
||||
.FirstOrDefault(m => m.Name == "GetTagInfoByName" && m.GetParameters().Length == 4);
|
||||
if (primeForDelete is not null)
|
||||
{
|
||||
object tibErr = Activator.CreateInstance(errorType)!;
|
||||
object?[] tibArgs = [tepTag, true, null, tibErr];
|
||||
try { primeForDelete.Invoke(access, tibArgs); } catch { }
|
||||
}
|
||||
MethodInfo? readForSync = accessType.GetMethods()
|
||||
.FirstOrDefault(m => m.Name == "GetTagExtendedPropertiesByName" && m.GetParameters().Length == 4);
|
||||
string? syncRead = null;
|
||||
if (readForSync is not null)
|
||||
{
|
||||
object syncErr = Activator.CreateInstance(errorType)!;
|
||||
object?[] syncArgs = [tepTag, true, null, syncErr];
|
||||
try
|
||||
{
|
||||
bool syncOk = (bool)readForSync.Invoke(access, syncArgs)!;
|
||||
syncRead = $"GetTagExtendedPropertiesByName(fetch)={syncOk} err={GetPropertyText(syncArgs[3]!, "ErrorDescription")}";
|
||||
}
|
||||
catch (TargetInvocationException ex) { syncRead = "read-for-sync threw: " + FormatException(ex.InnerException ?? ex); }
|
||||
}
|
||||
tepRows.Add(new { Kind = "ReadForSync", Detail = syncRead });
|
||||
|
||||
MethodInfo? delTepMethod = accessType.GetMethods()
|
||||
.FirstOrDefault(m => m.Name == "DeleteTagExtendedPropertiesByName" && m.GetParameters().Length == 4);
|
||||
if (delTepMethod is not null)
|
||||
@@ -420,10 +460,11 @@ internal static class Program
|
||||
namesColType.GetMethod("Add", new[] { typeof(string) })!.Invoke(names, [propName]);
|
||||
object delErr = Activator.CreateInstance(errorType)!;
|
||||
object?[] delArgs = [tepTag, names, true, delErr];
|
||||
WriteRuntimeMethodPointerSnapshot(assembly, runtimeMethodPointerOutput, runtimeMethodPointerFilters, repoRoot, scenario, "before-del-tep");
|
||||
bool delOk = false; string? delEx = null;
|
||||
try { delOk = (bool)delTepMethod.Invoke(access, delArgs)!; }
|
||||
catch (TargetInvocationException ex) { delEx = FormatException(ex.InnerException ?? ex); }
|
||||
tepRows.Add(new { Kind = "DeleteTagExtendedPropertiesByName", Success = delOk, Exception = delEx, ErrorDescription = GetPropertyText(delArgs[3]!, "ErrorDescription") });
|
||||
tepRows.Add(new { Kind = "DeleteTagExtendedPropertiesByName", Success = delOk, Exception = delEx, ErrorDescription = GetPropertyText(delArgs[3]!, "ErrorDescription"), ErrorCode = GetPropertyText(delArgs[3]!, "ErrorCode") });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user