Skip to content
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

Wrong number of requests in collection info #1912

Closed
blackr1234 opened this issue Mar 24, 2024 · 4 comments · Fixed by #2140
Closed

Wrong number of requests in collection info #1912

blackr1234 opened this issue Mar 24, 2024 · 4 comments · Fixed by #2140
Labels
bug Something isn't working

Comments

@blackr1234
Copy link

How to reproduce:

  1. Right-click on the collection on the left panel.
  2. Open "Settings" on the context menu.
  3. Click the "Info" tab in the center panel.
  4. The number of "Requests" is always the actual number + 1.

This number does not match the number shown on the Runner page.

@sanjai0py
Copy link
Member

Hey @blackr1234, what version of Bruno are you using right now? I tried recreating the issue on the latest version v1.12.3, but I wasn't able to.

@blackr1234
Copy link
Author

@sanjai0py
Sorry forgot to mention, it was 1.12.2.
Let me try the new version tonight, thanks!

@blackr1234
Copy link
Author

blackr1234 commented Mar 28, 2024

The issue is also happening in the latest version 1.12.3.

Please find below screenshot.

image

As you can see above, I have a brand new collection named abc and there is no request at all (the tree navigation menu is already expanded). However, the number of requests is 1.

Now, I add a new request:

image

As you can see above, the number of requests is now 2.

If we check the Runner page, we can find the correct number of requests:

image


OS: Windows 11
Bruno version: 1.12.3 (portable, free version)

@blackr1234
Copy link
Author

blackr1234 commented Mar 28, 2024

I would suggest reusing existing function for calculating the number of requests rather than writing two different implementations and using them in different places.

The calculation for the Runner page:

You have {totalRequestsInCollection} requests in this collection.

comes from below function:

https://github.com/usebruno/bruno/blob/main/packages/bruno-app/src/utils/collections/index.js#L616

The wrong one for the Collection page - Info tab:

https://github.com/usebruno/bruno/blob/main/packages/bruno-app/src/components/CollectionSettings/Info/index.js#L4


Root cause analysis:

  • I find that the problematic code actually treats bruno.json as a request, that's why it's always the actual number + 1.
  • By deleting the bruno.json file, I can see that the number of requests on the collection info page becomes correct. Undoing the deletion reverts the number of requests back to the actual number + 1.

@sanjai0py

Now I wonder why it doesn't happen to you. Is the issue platform-specific for some reason? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants