TBD54566975 / incubating-web5-labs

Apache License 2.0
25 stars 16 forks source link

Toggling "Completed" does not persist in DWN #60

Closed ALRubinger closed 1 year ago

ALRubinger commented 1 year ago

To reproduce:

I've verified that they're all set to completed=false when reading in from the DWN onBeforeMount.

I believe the problem is in toggleTodoComplete, where we call web5.dwn.records.write. I'm expecting a Record object to be returned but it's coming back as undefined?

  const { returnedRecordFromWrite } = await web5.dwn.records.write(myDid.id, {
    author  : myDid.id,
    data    : updatedTodoData,
    message : {
      recordId    : toggledTodo.id,
    }
  });

  /**
   * ALR Debugging toggling TODO, not persisted in DWN
   */
  // Why is this returning "undefined"? I don't think the write operation is overwriting the info in the DWN - ALR
  // Using docs from https://github.com/TBD54566975/web5-js#web5dwnrecordswritetarget-request
  console.log("Record object returned from dwn.records.write: " + returnedRecordFromWrite);
ALRubinger commented 1 year ago

Added commit above in my fork to highlight where I think the problem is? Calling in the @kirahsapong Big Guns.