qri-io / qri

you're invited to a data party!
https://qri.io
GNU General Public License v3.0
1.1k stars 66 forks source link

fix(transform): need to pass down InitIDs to `transform.Commit` #1911

Closed ramfox closed 2 years ago

ramfox commented 2 years ago

We rely on the init id in the TransformLifecyle event in the collection and on the frontend to coordinate the events to their proper datasets. I had an incorrect assumption, and did not realize that the datasets passed down to transform.Commit would not have their dataset.ID fields populated. Instead, we need to pass down the InitID for the dataset (if it exists) directly into the call to transform.Commit. The save path seems to expect the the ID field NOT be passed in when we go to save the dataset, which is why I did not choose to just ensure the dataset.ID field was populated before passing the dataset down into transform.Commit.

It is not a problem if the InitID field is not populated, and it is actually expected that this field is not populated for "apply" runs.