Skip to content

Items do not reorder when deleting request or directory #5721

@Skewnart

Description

@Skewnart

I have checked the following:

  • I have searched existing issues and found nothing related to my issue.

This bug is:

  • making Bruno unusable for me
  • slowing me down but I'm able to continue working
  • annoying
  • this feature was working in a previous version but is broken in the current release.

Bruno version

2.12.0

Operating System

Windows 11 26100.4946

Describe the bug

Deleting a request (query) or directory (folder) in the Sidebar (left) does not re-compute the order (sequence) of other items in the same directory / collection.
But inserting a new request or directory gives the new item its order depending on the total count of items in its current directory (total count + 1)

This means that after deleting and inserting something, two requests / directories in the same directory could have two identical sequence numbers or even an order higher than the total number of items, so a next creation could be inserted between two items.

Following pictures show this issue step by step.

.bru file to reproduce the bug

No response

Screenshots/Live demo link

First example

  1. Creating four example requests.
    Image

  2. Deleting the third one. The fourth keeps its order (4)
    Image

  3. Deleting the second. We now have the number 1 and 4... but there are only two items left.
    Image

  4. So creating a request will be the order 3 (cout 2 + 1) and won't be inserted at the end, but between the two others
    Image

Second example

  1. Creating three requests.
    Image

  2. Deleting the second. The thrid keeps its order (3)
    Image

  3. Adding a new request. It takes the sequence 3 (because count 2 + 1)
    Image

  4. So two items have the same order... And the problem begins.
    Image

The solution is to re-compute the order of all items left after a deletion and persist it.

I send a PR just after.
Thanks for the reading !

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1bugSomething isn't workinghas-pr

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions