-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
🐛 [Bug]: Naming of routes works wrong after mount #2688
Comments
related to #2685 #2686 does it work after that? |
Yes, I tried. The fix of Method+Path works well with flat application (single). But with multi-aps (with mount) is much more difficult to fix. I checked on master the testcase. It fails. |
be careful, I fixed some problems in testcase, use fresh one |
@efectn can you have a look at this |
@ReneWerner87 please, read the test-case. Check, if I expect behaviour well. If some mistakes or questions, let me know. |
okay now i understand naming apps is currently not yet possible only the last route, because an app is not a route this does not work either furthermore, currently, in order to merge the stacks of the apps, the startup process must be executed, otherwise the routes of the subapps cannot be found in the main app rootApp.startupProcess() or rootApp.mountStartupProcess() but this does not happen what do you think? is it a bug or feature? should we add this? @gaby @efectn |
Adding names to Apps looks like a new feature. Actually, I don't really need it. But all other is a problem of how mounting works. It look more like a bug. I tried also to add rootApp.startupProcess() after mount. It is not solving the problem. Still not getting routes by name from handler or from rootApp. |
will add it, sec |
The easy way: to add naming info when merging. But the problem is: when you add 2 sub-apps having the same names, they will conflict on names (if you have the same names in the tree). And when you make redirect inside handler with ctx.RedirectToLocation, it could take wrong route to make path. That is why it is not that easy to fix. Mounting is a great feature, but using it without handy Naming of routes is very difficult. |
this can also happen in the same app |
When you work on the same app, expected that you control unique route names and any conflicts are on your focus. |
after the merge of the pull request, i will close the bug, you can then create a feature request for our backlog feature is already useful |
@ReneWerner87 thank you very much! Very fast solving of problems. Fixing of both problems will make working with Fiber much more convenient. |
Now I just have to wait until tag-release ;) When it is usually expected? Few days or weeks? |
1 similar comment
Now I just have to wait until tag-release ;) When it is usually expected? Few days or weeks? |
some days |
Bug Description
Naming of routes after mounting sub-apps into root app works wrong.
All routes turn into flat map of routes, but expected that they all separately work without any changing in original sub-apps.
Also there is no way to set names of sub-apps (but it could be great, as groups have this feature).
How to Reproduce
Steps to reproduce the behavior:
Expected Behavior
Expected, that I can use naming in some sub-apps and it works. And after that if I mount sub-app to root-app, naming also works, but with correct prefixes (of paths and of names, like it works with groups).
I added some test, that could be placed into the end of app_test.go. Check if the proposal behaviour is correct.
Fiber Version
v2.50.0
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: