Problem
In packages/durabletask-js/src/client/client.ts, the convertEntityMetadata() method (line 1208) uses new Date() (current time) as the default when the protobuf lastModifiedTime field is missing:
const lastModifiedTime = protoMetadata.getLastmodifiedtime()?.toDate() ?? new Date();
This is inconsistent with _createOrchestrationStateFromProto() in the same file (lines 1243-1244), which correctly uses new Date(0) (Unix epoch) for missing timestamps:
const createdAt = createdTimestamp ? createdTimestamp.toDate() : new Date(0);
const lastUpdatedAt = lastUpdatedTimestamp ? lastUpdatedTimestamp.toDate() : new Date(0);
Root Cause
The fallback value was written as new Date() instead of new Date(0). This appears to be an oversight — every other missing-timestamp default in the same file uses epoch.
Proposed Fix
Change new Date() to new Date(0) on line 1208 to match the established pattern.
Impact
Severity: Medium — When a protobuf EntityMetadata response has no lastModifiedTime set, callers receive the current wall-clock time instead of a sentinel epoch value. This makes it impossible to distinguish between "entity was just modified" and "entity has no known modification time", potentially causing incorrect display, sorting, or filtering logic in consuming code.
Problem
In
packages/durabletask-js/src/client/client.ts, theconvertEntityMetadata()method (line 1208) usesnew Date()(current time) as the default when the protobuflastModifiedTimefield is missing:This is inconsistent with
_createOrchestrationStateFromProto()in the same file (lines 1243-1244), which correctly usesnew Date(0)(Unix epoch) for missing timestamps:Root Cause
The fallback value was written as
new Date()instead ofnew Date(0). This appears to be an oversight — every other missing-timestamp default in the same file uses epoch.Proposed Fix
Change
new Date()tonew Date(0)on line 1208 to match the established pattern.Impact
Severity: Medium — When a protobuf
EntityMetadataresponse has nolastModifiedTimeset, callers receive the current wall-clock time instead of a sentinel epoch value. This makes it impossible to distinguish between "entity was just modified" and "entity has no known modification time", potentially causing incorrect display, sorting, or filtering logic in consuming code.