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

Router doesn't recognise routes having query parameter(s) without a trailing slash #636

Closed
shubhamsinghshubham777 opened this issue Dec 25, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@shubhamsinghshubham777
Copy link

This ticket is made in continuation to our conversation here: #588 (comment)

As mentioned here, just like the client side navigation logic will try to add a slash if /example-route isn't found but /example-route/ is, I'd expect the same behaviour from the router when dealing with routes having query parameters.

The simplest reproducer of this issue is:

  1. Create a file named Index.kt inside your_package.pages.results package
  2. Create a composable annotated with @Page
  3. Once done, try to run this URL from your browser:
    http://localhost:8080/results/?search_query=test
    
  4. The router should be able to find and display your page
  5. Then try to run this from your browser:
    http://localhost:8080/results?search_query=test
    
  6. Observe that the router is not able to find this URL.
@shubhamsinghshubham777 shubhamsinghshubham777 added the bug Something isn't working label Dec 25, 2024
@bitspittle bitspittle self-assigned this Dec 25, 2024
@bitspittle
Copy link
Collaborator

Set kobweb to 0.20.1-SNAPSHOT in your libs.versions.toml file and see if the behavior matches what you expect.

Assuming it works, here's the commit, if you're curious!

@shubhamsinghshubham777
Copy link
Author

Set kobweb to 0.20.1-SNAPSHOT in your libs.versions.toml file and see if the behavior matches what you expect.

Assuming it works, here's the commit, if you're curious!

Yes it works as expected 🙌🏻 Thank you. We can close this ticket now.

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

No branches or pull requests

2 participants