Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) prevent 500 server error on a just removed folder when listing files #3553

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

tobitege
Copy link
Collaborator

@tobitege tobitege commented Aug 23, 2024

What is the problem that this fixes or functionality that this introduces? Does it fix any open issues?

If a folder in the workspace is being removed (in the actual filesystem, outside of OpenHands) and then in the UI the "Refresh" icon on the file explorer is clicked, an error "500 internal server error" will appear in the UI. This PR prevents this.


Give a summary of what the PR does, explaining any non-trivial design decisions

Instead of returning a 400 error from the runtime client back in case a folder no longer exists, this should just return an empty list and not error about it, which is confusing in the UI.


Other references

@tobitege tobitege added enhancement New feature or request frontend Related to frontend labels Aug 23, 2024
Copy link
Contributor

@neubig neubig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little bit confused by this. Is it only the case that this error would be thrown when a user just removed a folder? It seems like it also might be thrown if we call list_files on a file/directory that never existed in the first place.

@tobitege
Copy link
Collaborator Author

I'm a little bit confused by this. Is it only the case that this error would be thrown when a user just removed a folder? It seems like it also might be thrown if we call list_files on a file/directory that never existed in the first place.

Just for illustration, my workspace has these entries:
grafik

So if I'd go outside of OH and removed the folder "temp2" myself and then clicked the "Refresh" button, the UI would retrieve the error as the list_files would still think it existed and try to get the content for it, still.
And that error message is now removed.

@tobitege tobitege requested a review from xingyaoww August 23, 2024 15:42
Copy link
Collaborator

@xingyaoww xingyaoww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM! Although i wonder if the file structure will also be updated on the FE side, so it will not call list file on the same folder next time?

@tobitege
Copy link
Collaborator Author

This LGTM! Although i wonder if the file structure will also be updated on the FE side, so it will not call list file on the same folder next time?

Yes, the file explorer is updated correctly.

@tobitege tobitege merged commit fc5f026 into All-Hands-AI:main Aug 23, 2024
@tobitege tobitege deleted the runtime-list-files-fix branch August 23, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend Related to frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants