mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #4308] [bug]: When deleting a request, tab to collection mapping comes out of sync. This causes the incorrect tab to be opened when selecting a request. #1567
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#1567
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @samMolyneux on GitHub (Aug 29, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4308
Is there an existing issue for this?
Current behavior
In the below video you can see that once 'Test 4' is deleted, selecting other requests in the collection causes the wrong tab to be brought into focus. For 'Test 1' a duplicate tab is created.
https://github.com/user-attachments/assets/ea99100e-30d8-4e06-bbd9-cfdb0456019e
This indicates that there is faulty logic in the tab reordering in
resolveSaveContextOnRequestReorderinpackages/hoppscotch-common/src/helpers/collection/request.tswhich is triggered by the 'remove-request' event inhoppscotch-common/src/components/collections.The tab => request mapping appears to be off by one when used for the delete, likely due to the code on line 29 not being executed for a delete (as newIndex is -1). This causes the tab relating to the request above the one selected to be opened. In the case of the first request, there is no tab with the matching index so a new tab is created.
Steps to reproduce
Environment
Production
Version
Cloud
@anwarulislam commented on GitHub (Mar 19, 2025):
This issue cannot be reproduced now and may have been fixed. Therefore, I am closing it as completed.