unkey icon indicating copy to clipboard operation
unkey copied to clipboard

Client-side exception occurs when adding a filter to rate limit logs table with no data

Open unrenamed opened this issue 1 year ago • 9 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 there are no rate limit logs available, clicking "Add Filter" and selecting any type of filter causes a client-side exception as soon as a character is entered into the filter input. The entire page fails, and the following error is displayed in the DevTools console: undefined is not iterable.

It is currently unclear whether this issue persists when there is at least one log entry in the table.

Observed Behavior:

  • A client-side exception occurs (undefined is not iterable).
  • The entire page becomes unresponsive or crashes.
  • The logs table does not handle the filter input correctly.

Steps to Reproduce

  1. Go to the created ratelimit page
  2. Head over the "Logs" tab
  3. Ensure the rate limit logs table is empty
  4. Click "Add filter" and choose any filter option
  5. Press any character in the filter input field

Expected behavior

  • If no logs are present, the filter input should be handled gracefully, and no exceptions should occur.
  • The page should remain functional, even if no data matches the filter criteria.
  • If the filter doesn't return any results (due to no data), an appropriate "No results found" message should be displayed without breaking the UI.
  • If logs are present, the filter should work as expected, narrowing down the results without triggering any errors.

Other information

No response

Screenshots

https://github.com/user-attachments/assets/b122d175-5eda-4896-b7d0-61862842c7be

Version info

- OS:
- Node:
- npm:

unrenamed avatar Oct 13 '24 15:10 unrenamed

I can replicate the same error in the identifier input with and without requests on the ratelimit overview page.

CleanShot 2024-10-13 at 18 00 46@2x

Flo4604 avatar Oct 13 '24 16:10 Flo4604

@Flo4604 Good catch! I've just noticed the same on my side.

unrenamed avatar Oct 13 '24 16:10 unrenamed

/award 50

perkinsjr avatar Oct 21 '24 15:10 perkinsjr

Awarding unrenamed: 50 points 🕹️ Well done! Check out your new contribution on oss.gg/unrenamed

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

/assign

unrenamed avatar Oct 21 '24 15:10 unrenamed

You already have an open issue assigned to you here. Once that's closed or unassigned, only then we recommend you to take up more.

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

/assign

RajuGangitla avatar Oct 21 '24 16:10 RajuGangitla

Assigned to @RajuGangitla! 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 21 '24 16:10 oss-gg[bot]

@RajuGangitla, please open a draft PR linking this issue within 12 hours. If we can't detect a PR in 12 hours, you will be unassigned automatically.

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