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

/paths should 404 if there are not assets with path_prefix/ #546

Closed
yarikoptic opened this issue Oct 4, 2021 · 5 comments
Closed

/paths should 404 if there are not assets with path_prefix/ #546

yarikoptic opened this issue Oct 4, 2021 · 5 comments
Assignees
Labels
bug Something isn't working UX Affects usability of the system

Comments

@yarikoptic
Copy link
Member

$> curl -X GET "https://api.dandiarchive.org/api/dandisets/000003/versions/draft/assets/paths/?path_prefix=junk%2F" -H  "accept: application/json"

{"folders":{},"files":{}}% 

ATM it would just happily return empty lists, and as a result web ui would just render an empty folder. Go e.g. go to https://gui.dandiarchive.org/#/dandiset/000108/draft/files?location=junk

I think it would be more appropriate for dandi-api to 404 whenever both folders and files are empty, and web ui also have some error shown in such cases.

@waxlamp waxlamp added the bug Something isn't working label Oct 4, 2021
@waxlamp
Copy link
Member

waxlamp commented Oct 4, 2021

Thanks Yarik, this is definitely a bug.

@waxlamp waxlamp added the UX Affects usability of the system label Dec 31, 2021
@waxlamp waxlamp added this to the Web app usability milestone Mar 8, 2023
@waxlamp
Copy link
Member

waxlamp commented Mar 8, 2023

This is half complete... navigating to a non-existing location shows an appropriate error message in the web app, but it implies that the folder exists and just has no files in it. We can improve the behavior to be more explicit that the path itself doesn't exist.

@yarikoptic
Copy link
Member Author

indeed this was actually fixed at the level of API:

❯ curl -X GET "https://api.dandiarchive.org/api/dandisets/000003/versions/draft/assets/paths/?path_prefix=junk%2F" -H  "accept: application/json"
{"detail":"Specified path not found."}% 

and the only remaining need here is to fix web UI -- what would that take???

@yarikoptic
Copy link
Member Author

@waxlamp any ETA for the fix for the acknowledged bug?

@yarikoptic
Copy link
Member Author

Actually, API does not just return that record but also 404s:

❯ curl -X GET "https://api.dandiarchive.org/api/dandisets/000108/versions/draft/assets/paths/?path_prefix=lkajsdf" --dump-header -
HTTP/1.1 404 Not Found
Report-To: {"group":"heroku-nel","max_age":3600,"endpoints":[{"url":"https://nel.heroku.com/reports?ts=1737044119&sid=c46efe9b-d3d2-4a0c-8c76-bfafa16c5add&s=vePnXF1%2FYB%2FcBgf67zNZIyW4MxJESrcRVMahm5qh0Sk%3D"}]}
Reporting-Endpoints: heroku-nel=https://nel.heroku.com/reports?ts=1737044119&sid=c46efe9b-d3d2-4a0c-8c76-bfafa16c5add&s=vePnXF1%2FYB%2FcBgf67zNZIyW4MxJESrcRVMahm5qh0Sk%3D
Nel: {"report_to":"heroku-nel","max_age":3600,"success_fraction":0.005,"failure_fraction":0.05,"response_headers":["Via"]}
Connection: keep-alive
Server: gunicorn
Date: Thu, 16 Jan 2025 16:15:19 GMT
Content-Type: application/json
Vary: Accept, Cookie, origin
Allow: GET, HEAD, OPTIONS
X-Frame-Options: DENY
Content-Length: 38
Strict-Transport-Security: max-age=31536000
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
Cross-Origin-Opener-Policy: same-origin
Via: 1.1 vegur

{"detail":"Specified path not found."}%

and since web UI/files browser does return specific message of having nothing there, I think we can just consider this issue addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working UX Affects usability of the system
Projects
None yet
Development

No branches or pull requests

2 participants