Surfaced (not introduced) by the strictNullChecks review of #208; confirmed pre-existing and byte-identical to the base behavior.
Problem
When a Signal K updates delta arrives with no context field, DataService.setPathContext(context, path) computes the storage key as:
context !== this._selfUrn ? `${context}.${path}` : `${SELFROOTDEF}.${path}`
With context === undefined, undefined !== this._selfUrn is true, so the value is filed under the literal key `${undefined}.${path}` — e.g. undefined.navigation.position. Widgets subscribed to self.<path> never see that data; it is silently misfiled rather than treated as self.
The interface comments (IPathValueData.context, IMeta.context) state "empty context should assume the message is from Self", but setPathContext doesn't special-case empty/undefined — so the documented intent and the code diverge.
Why it's low-priority
Real Signal K servers always include context in delta updates, so this only triggers for a non-conforming producer. #208 deliberately preserved the behavior (the honest string | undefined typing surfaced it without changing runtime), and the delta-service updates win test now pins that a context-less message emits context: undefined.
Fix direction
Treat empty/undefined context as self in setPathContext (fold it to SELFROOTDEF), matching the documented "empty context assumes Self" contract. Add a DataService test asserting the path key produced for a context-less message once the self URN has been learned.
Location
src/app/core/services/data.service.ts — setPathContext
Refs #6, #208
Surfaced (not introduced) by the strictNullChecks review of #208; confirmed pre-existing and byte-identical to the base behavior.
Problem
When a Signal K
updatesdelta arrives with nocontextfield,DataService.setPathContext(context, path)computes the storage key as:With
context === undefined,undefined !== this._selfUrnis true, so the value is filed under the literal key`${undefined}.${path}`— e.g.undefined.navigation.position. Widgets subscribed toself.<path>never see that data; it is silently misfiled rather than treated as self.The interface comments (
IPathValueData.context,IMeta.context) state "empty context should assume the message is from Self", butsetPathContextdoesn't special-case empty/undefined — so the documented intent and the code diverge.Why it's low-priority
Real Signal K servers always include
contextin delta updates, so this only triggers for a non-conforming producer. #208 deliberately preserved the behavior (the honeststring | undefinedtyping surfaced it without changing runtime), and the delta-serviceupdates wintest now pins that a context-less message emitscontext: undefined.Fix direction
Treat empty/undefined context as self in
setPathContext(fold it toSELFROOTDEF), matching the documented "empty context assumes Self" contract. Add a DataService test asserting the path key produced for a context-less message once the self URN has been learned.Location
src/app/core/services/data.service.ts—setPathContextRefs #6, #208