[đšī¸] Switching Workspace when api selected leads to 404
Preliminary Checks
-
[X] I have reviewed the documentation: https://unkey.com/docs
-
[X] I have searched for existing issues: https://github.com/unkeyed/unkey/issues
-
[X] This issue is not a question, general help request, or anything other than a bug report directly related to Unkey. Please ask questions in our Discord community: https://unkey.com/discord.
Reproduction / Replay Link (Optional)
No response
Issue Summary
When I select an API in a workspace and switch to another workspace, I get a 404 page.
Steps to Reproduce
- Select a API in a workspace
- Switch to another workspace
- See 404 page See repro video
Expected behavior
I would like to be redirected to the API overview instead
Other information
No response
Screenshots
https://github.com/user-attachments/assets/a8875a58-102d-4595-a6e4-c9f700505f6e
Version info
-
Yes!!
In /apis/[apiId]/page.tsx we should return redirect("/apis") instead of return notFound()
/award 150
Awarding Flo4604: 150 points đšī¸ Well done! Check out your new contribution on oss.gg/Flo4604
/assign
Assigned to @AkshayBandi027! Please open a draft PR linking this issue within 48h â ī¸ If we can't detect a PR from you linking this issue in 48h, you'll be unassigned automatically đšī¸ Excited to have you ship this đ
Hey @chronark !! the problem is occurring across multiple dynamic routes, including API , rate limiting, and authorization. When a user changes their organization, it cannot the specific data, so its returns notfound()
Two Potential Solutions
Router Push Solution: When the user changes their organization, the router can push to a standard route (e.g., /apis) instead of the current route. in changeOrg function . router.push("/apis")
Redirect Solution: we need to add redirect in mulitple dynamic route inlcuding api,rate limiting and authorization . (e.g. In /apis/[apiId]/page.tsx we should return redirect("/apis") instead of return notFound())
We're about to change how the changeOrg stuff works, let's not change that now.
I also think handling this per page and setting a better fallback (ie /apis) is better in general, cause it's more explicit and catches the error even if the root cause is something other than changing orgs
@AkshayBandi027, Just a little reminder: Please open a draft PR linking this issue within 12 hours. If we can't detect a PR in 12h, you will be unassigned automatically.
@AkshayBandi027, Just a little reminder: Please open a draft PR linking this issue within 12 hours. If we can't detect a PR in 12h, you will be unassigned automatically.
/assign
This issue is already assigned to another person. Please find more issues here.
@chronark I think no one is working on this can I work on this
/assign
This issue is already assigned to another person. Please find more issues here.
/assign
Assigned to @diwasrimal! Please open a draft PR linking this issue within 48h â ī¸ If we can't detect a PR from you linking this issue in 48h, you'll be unassigned automatically đšī¸ Excited to have you ship this đ
@chronark I first asked you to assign it to me đĨš
@mohitejaikumar this month, all issues can be assigned by you via /assign, maintainers don't assign issues manually right now
you can read more on https://oss.gg
/assign
This issue is already assigned to another person. Please find more issues here.
/assign
This issue is already assigned to another person. Please find more issues here.
/unassign
Issue unassigned.
/assign
Assigned to @anuj5926! Please open a draft PR linking this issue within 48h â ī¸ If we can't detect a PR from you linking this issue in 48h, you'll be unassigned automatically đšī¸ Excited to have you ship this đ
@anuj5926, Just a little reminder: Please open a draft PR linking this issue within 12 hours. If we can't detect a PR in 12h, you will be unassigned automatically.
/assign
This issue is already assigned to another person. Please find more issues here.