unkeyed / unkey

Open source API management platform
https://go.unkey.com
Other
4.21k stars 498 forks source link

Creating ratelimit in the new workspace shows it in the personal workspace too #2395

Open harshsbhat opened 2 weeks ago

harshsbhat commented 2 weeks ago

Preliminary Checks

Reproduction / Replay Link (Optional)

No response

Issue Summary

After creating the new rate limit in your workspace ( not personal ). It is still visible in the personal workspace. But if you click on it that will just redirect you to 404.

https://www.loom.com/share/d34c1076ee524a1abeaaabb15306a398?sid=d301ee35-5022-4f77-a37e-9c60343d8171

Steps to Reproduce

  1. Shift to a non-personal workspace.
  2. Create a ratelimit
  3. Switch back to your personal workspace. You will still see the same ratelimit. But it will redirect to 404.

Expected behavior

Ideally it shouldn't be visible after switching workspaces

Other information

No response

Screenshots

No response

Version info

- OS:
- Node:
- npm:
linear[bot] commented 2 weeks ago

ENG-1455 Creating ratelimit in the new workspace shows it in the personal workspace too

unrenamed commented 2 weeks ago

It seems that all previously loaded data remains cached unless the page is reloaded. After creating a new workspace, you can skip the optional "Choose your adventure" step. When you navigate to any page via the left side menu—such as APIs, Audit Logs, or Rate Limits—you will notice that all pages display data from the previously selected workspace.

harshsbhat commented 2 weeks ago

@unrenamed but what's the solution? I don't think that it's the best experience to see this right?

unrenamed commented 2 weeks ago

@harshsbhat I agree with you. This is definitely a bug and the root cause somewhere in the client code that automatically switches to the created workspace.

My message was that I can reproduce the issue on my side and it appears to occur not only with ratelimits but other pages as well.

harshsbhat commented 2 weeks ago

ah got it. I thought I was not understanding something which was causing the issue. Thanks for clarification though

unrenamed commented 2 weeks ago

P.S. I see the confusion. The issue you found and the one I faced with are a bit different, although something tells me they might be related and fixed together.

See the steps:

  1. Create a new workspace
  2. Skip the "Choose your adventure" step
  3. (The new workspace will be automatically selected)
  4. Now go to any page from the side menu (e.g. APIs or Ratelimits or Audit Logs)
  5. You will see the data from the previous workspace.
chronark commented 2 weeks ago

Yeah, this is related to how we currently switch workspaces using clerk, it'll be different soon.

Assigning @mcstepp to double check this is fixed in the new implementation