posit-dev / publisher

MIT License
5 stars 0 forks source link

Workbench: Deleting a `.posit` directory results in error #2031

Closed kgartland-rstudio closed 2 months ago

kgartland-rstudio commented 3 months ago

When deleting the .posit dir in Workbench after a deployment the UI throws this error:

Failed to refresh files. An error has occurred at sendRefreshedFilesLists, files.getByConfiguration, StatusText=Not Found, Code=ERR_BAD_REQUEST, Msg=Request failed with status code 404, URL=http://localhost:34369/api/get//configurations/configuration-2/files

This does not seem to occur in other Linux environments.

mmarchetti commented 3 months ago

Could this be a case where file watcher events were not triggered to reset the home view selection?

Should the configuration files API return something different in the case where the named configuration can't be found?

dotNomad commented 2 months ago

I'm getting a code smell of a race condition when I look into this. I'm not able to re-create locally, but I think it may be too fast at refreshing things. Unfortunately it is a bit hard to debug on workbench, but perhaps I can put some artificial delays in the code to attempt to reproduce.

dotNomad commented 2 months ago

I haven't been able to reproduce this, but I still suspect there is a race condition here that could occur. I will bounce this back to triage to decide what to do.

dotNomad commented 2 months ago

A large amount of file deletions seems to cause this as well - like deleting a large Python virtual environment.

Could be the same issue.

dotNomad commented 2 months ago

After some discussion these sort of errors could be ignored. It is most likely because the config we have "selected" hasn't been updated when we get other file watcher events, but we will get to a good state after all file watcher events run.

Since we don't show the file list with nothing selected this error isn't particularly helpful.

sagerb commented 2 months ago

Can we retest this, since we've merged a significant amount of changes/fixes to the file watcher and request code?

dotNomad commented 2 months ago

Closing this one because it is done.