{"record":{"id":"65e1c06c5cf4bc63","repo":"different-ai/openwork","slug":"invalid-timestamp-expected-non-negative-number-g","errorCode":null,"errorMessage":"Invalid timestamp: expected non-negative number, got ${msecs}","messagePattern":"Invalid timestamp: expected non-negative number, got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ee/packages/utils/src/typeid.ts","lineNumber":241,"sourceCode":"const typeIdWithTimestamp = <const T extends IdTypePrefixNames>(\n  typeName: T,\n  timestamp?: Date | number,\n): TypeId<T> => {\n  let msecs: number\n\n  if (timestamp === undefined) {\n    msecs = DateTime.now().toMillis()\n  } else if (timestamp instanceof Date) {\n    msecs = timestamp.getTime()\n  } else {\n    msecs = timestamp\n  }\n\n  if (!Number.isFinite(msecs)) {\n    throw new Error(`Invalid timestamp: expected finite number, got ${msecs}`)\n  }\n  if (msecs < 0) {\n    throw new Error(`Invalid timestamp: expected non-negative number, got ${msecs}`)\n  }\n\n  const uuid = uuidv7({ msecs })\n  const prefix = idTypesMapNameToPrefix[typeName]\n  return TypeID.fromUUID(prefix, uuid).toString() as TypeId<T>\n}\n\nconst getColumnLength = <const T extends IdTypePrefixNames>(typeName: T) =>\n  idTypesMapNameToPrefix[typeName].length + 1 + TYPE_ID_SUFFIX_LENGTH\n\nexport const typeId = {\n  schema: typeIdZodSchema,\n  generator: typeIdGenerator,\n  generatorWithTimestamp: typeIdWithTimestamp,\n  validator: validateTypeId,\n  infer: inferTypeId,\n  fromString: typeIdFromString,\n  suffixLength: TYPE_ID_SUFFIX_LENGTH,","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/packages/utils/src/typeid.ts#L223-L259","documentation":"Error \"Invalid timestamp: expected non-negative number, got ${msecs}\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at ee/packages/utils/src/typeid.ts:241 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}