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

UI: Prefix routes with /library/... so that 404 can be returned for non-existing assets #840

Closed
benmccann opened this issue Jan 6, 2021 · 4 comments
Assignees
Labels
idea Feedback wanted / feature request released Available in the stable release

Comments

@benmccann
Copy link
Contributor

During development I was requesting a JS file that did not exist. However, it took me a very long time to figure this out because the browser was returning a 200. I thought I had Babel configured wrong or something because it kept telling me I had a malformed JS file. In reality it was returning HTML inside my JS

@lastzero
Copy link
Member

lastzero commented Jan 7, 2021

Routing is performed on the client. There is no simple way the server may know what routes exist in JS - and we can't afford to add much more complexity right now.

We may of course implement a 404 page in JS saying "No found, click here to return to home" instead of redirecting to home straight away. Not sure how much value this provides to our users though.

@benmccann
Copy link
Contributor Author

Ah, that makes sense. While we can't do it for a generic route, we might be to implement a 404 just for non-existent .js and .css files

@benmccann benmccann changed the title Implement 404 page Return 404 result for assets that don't exist Jan 7, 2021
@benmccann
Copy link
Contributor Author

It looks like this would be handled here:

router.NoRoute(func(c *gin.Context) {

@lastzero lastzero added the idea Feedback wanted / feature request label Feb 17, 2021
@lastzero lastzero changed the title Return 404 result for assets that don't exist UI: Prefix routes with /library/... so that 404 can be returned for non-existing assets Oct 14, 2022
@lastzero lastzero self-assigned this Oct 14, 2022
lastzero added a commit that referenced this issue Oct 15, 2022
Also improves migrations and updates the db schema docs.

Signed-off-by: Michael Mayer <michael@photoprism.app>
lastzero added a commit that referenced this issue Oct 15, 2022
Signed-off-by: Michael Mayer <michael@photoprism.app>
lastzero added a commit that referenced this issue Oct 19, 2022
Signed-off-by: Michael Mayer <michael@photoprism.app>
lastzero added a commit that referenced this issue Oct 20, 2022
Signed-off-by: Michael Mayer <michael@photoprism.app>
lastzero added a commit that referenced this issue Oct 20, 2022
Signed-off-by: Michael Mayer <michael@photoprism.app>
@graciousgrey graciousgrey added the please-test Ready for acceptance test label Oct 23, 2022
lastzero added a commit that referenced this issue Oct 24, 2022
Signed-off-by: Michael Mayer <michael@photoprism.app>
lastzero added a commit that referenced this issue Oct 24, 2022
Signed-off-by: Michael Mayer <michael@photoprism.app>
lastzero added a commit to photoprism/photoprism-docs that referenced this issue Oct 24, 2022
lastzero added a commit to photoprism/photoprism-docs-de that referenced this issue Oct 24, 2022
@lastzero lastzero removed the please-test Ready for acceptance test label Nov 4, 2022
@lastzero
Copy link
Member

lastzero commented Nov 4, 2022

Nobody complained so far, so I'll move ahead and close this as done!

@lastzero lastzero closed this as completed Nov 4, 2022
@lastzero lastzero added the released Available in the stable release label Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Feedback wanted / feature request released Available in the stable release
Projects
Status: Release 🌈
Development

No branches or pull requests

3 participants