unkey icon indicating copy to clipboard operation
unkey copied to clipboard

[đŸ•šī¸] Switching Workspace when api selected leads to 404

Open Flo4604 opened this issue 1 year ago â€ĸ 31 comments

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

  1. Select a API in a workspace
  2. Switch to another workspace
  3. 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

-

Flo4604 avatar Oct 05 '24 16:10 Flo4604

Yes!!

In /apis/[apiId]/page.tsx we should return redirect("/apis") instead of return notFound()

chronark avatar Oct 05 '24 17:10 chronark

/award 150

chronark avatar Oct 05 '24 17:10 chronark

Awarding Flo4604: 150 points đŸ•šī¸ Well done! Check out your new contribution on oss.gg/Flo4604

oss-gg[bot] avatar Oct 05 '24 17:10 oss-gg[bot]

/assign

AkshayBandi027 avatar Oct 05 '24 17:10 AkshayBandi027

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 🚀

oss-gg[bot] avatar Oct 05 '24 17:10 oss-gg[bot]

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())

AkshayBandi027 avatar Oct 05 '24 17:10 AkshayBandi027

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

chronark avatar Oct 05 '24 18:10 chronark

@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.

oss-gg[bot] avatar Oct 07 '24 05:10 oss-gg[bot]

@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.

oss-gg[bot] avatar Oct 09 '24 05:10 oss-gg[bot]

/assign

mohitejaikumar avatar Oct 10 '24 15:10 mohitejaikumar

This issue is already assigned to another person. Please find more issues here.

oss-gg[bot] avatar Oct 10 '24 15:10 oss-gg[bot]

@chronark I think no one is working on this can I work on this

mohitejaikumar avatar Oct 10 '24 15:10 mohitejaikumar

/assign

adkibhaskar avatar Oct 10 '24 16:10 adkibhaskar

This issue is already assigned to another person. Please find more issues here.

oss-gg[bot] avatar Oct 10 '24 16:10 oss-gg[bot]

/assign

diwasrimal avatar Oct 10 '24 16:10 diwasrimal

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 🚀

oss-gg[bot] avatar Oct 10 '24 16:10 oss-gg[bot]

@chronark I first asked you to assign it to me đŸĨš

mohitejaikumar avatar Oct 10 '24 16:10 mohitejaikumar

@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

chronark avatar Oct 11 '24 12:10 chronark

/assign

mohitejaikumar avatar Oct 11 '24 13:10 mohitejaikumar

This issue is already assigned to another person. Please find more issues here.

oss-gg[bot] avatar Oct 11 '24 13:10 oss-gg[bot]

/assign

no-naame avatar Oct 14 '24 05:10 no-naame

This issue is already assigned to another person. Please find more issues here.

oss-gg[bot] avatar Oct 14 '24 05:10 oss-gg[bot]

/unassign

diwasrimal avatar Oct 15 '24 02:10 diwasrimal

Issue unassigned.

oss-gg[bot] avatar Oct 15 '24 02:10 oss-gg[bot]

/assign

anuj5926 avatar Oct 15 '24 04:10 anuj5926

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 🚀

oss-gg[bot] avatar Oct 15 '24 04:10 oss-gg[bot]

@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.

oss-gg[bot] avatar Oct 18 '24 04:10 oss-gg[bot]

/assign

mohitejaikumar avatar Oct 19 '24 09:10 mohitejaikumar

This issue is already assigned to another person. Please find more issues here.

oss-gg[bot] avatar Oct 19 '24 09:10 oss-gg[bot]