qri-io / desktop

Qri Desktop
https://qri.io/desktop
GNU General Public License v3.0
67 stars 14 forks source link

Checkout leaves app in a bad state #379

Closed dustmop closed 4 years ago

dustmop commented 4 years ago

On my machine, with a newly created dataset, I click "checkout files", choose a location, and then "checkout". The call to "/checkout" successfully updates the ref, makes the directory, writes component files to that location, and creates the link file. Next, Desktop requests the dataset head, which also works. Then, it requests "/body" and this fails. The reason is that it sends the full path to the backend (like "/body/my_user/my_ds/at/QmHAsH") but CanonicalizeDatasetRef fails to assign an FSIPath to a full path.

The result is that dataset is actually checked out, but the dialog remains open with the error message "dataset is not linked to filesystem".

  1. This is really a backend bug. CanonicalizeDatasetRef should add the FSIPath for refs with a full refs. No tests exist for this use case
  2. At some point this worked in Desktop. Is the call to "/body" new? Or did it not used to send the full path? Or was the error response being ignored
  3. This is a good example of where we should have an e2e test to catch regressions
  4. This is also something that logging can help debug in the future
ramfox commented 4 years ago

new e2e test catches this bug exactly!!

dustmop commented 4 years ago

Fixed by https://github.com/qri-io/qri/pull/1070