@tangle-network/agent-provider-tangle 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -713,7 +713,9 @@ function validSnapshotOperationResult(value) {
713
713
  function validForkOperationChildResult(value) {
714
714
  return (validOperationRecord(value) &&
715
715
  safeIdentifier(value.sandboxId ?? value.id) !== undefined &&
716
- validOperationDate(value.createdAt));
716
+ (value.createdAt === undefined ||
717
+ value.createdAt === null ||
718
+ validOperationDate(value.createdAt)));
717
719
  }
718
720
  function checkpointMarkerTags(request) {
719
721
  const marker = {
@@ -948,6 +950,8 @@ async function findForkByKey(client, box, provider, key, signal) {
948
950
  * Fork inventory can report a child timestamp from a later registry read. The
949
951
  * operation ledger stores the original child acknowledgement, which is the
950
952
  * stable value required to replay one exact fork reference after a restart.
953
+ * Some Sandbox responses omit that timestamp, so the validated inventory
954
+ * record supplies it only when the operation result does not.
951
955
  */
952
956
  function childFromOperationResult(child, lookup) {
953
957
  if (lookup.result === undefined) {
@@ -963,7 +967,10 @@ function childFromOperationResult(child, lookup) {
963
967
  (candidate.sandboxId ?? candidate.id) === child.id);
964
968
  if (!operationChild)
965
969
  return undefined;
966
- return { child, createdAt: operationChild.createdAt };
970
+ const createdAt = operationChild.createdAt ?? child.createdAt;
971
+ if (!validOperationDate(createdAt))
972
+ return undefined;
973
+ return { child, createdAt };
967
974
  }
968
975
  async function findForkChildById(client, box, provider, id, signal) {
969
976
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-provider-tangle",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "AgentEnvironmentProvider adapter for Tangle sandboxes",
5
5
  "type": "module",
6
6
  "license": "MIT",