[PR #5781] [MERGED] fix(common): prevent duplication of request ID when duplicating requests #5346

Closed
opened 2026-03-17 02:48:15 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5781
Author: @anwarulislam
Created: 1/19/2026
Status: Merged
Merged: 1/19/2026
Merged by: @jamesgeorge007

Base: nextHead: fix/duplicate-request-issue


📝 Commits (1)

  • f43a2ca fix(common): prevent duplication of request ID when duplicating requests

📊 Changes

2 files changed (+4 additions, -2 deletions)

View changed files

📝 packages/hoppscotch-common/src/components/collections/graphql/index.vue (+2 -1)
📝 packages/hoppscotch-common/src/components/collections/index.vue (+2 -1)

📄 Description

Closes FE-1115

Summary

  • Fix bug where duplicating a request in collections created a duplicate with the same backend request ID
  • This caused issues when logged in: duplicated requests couldn't be deleted, renamed, or edited
  • The fix removes the id field when duplicating, allowing the backend to generate a new unique ID

Changes

  • Remove id field from request when duplicating (both REST and GraphQL)
  • This ensures each request has a unique backend ID
  • Backend correctly assigns new IDs for duplicated requests

Testing

  • Login
  • Duplicate a request in collection → reload → delete works ✓
  • Duplicate a request in collection → reload → rename works ✓
  • Duplicate a request in collection → reload → edit works ✓
  • Both REST and GraphQL requests fixed ✓
  • Resolves issue where original request disappeared after duplicating and renaming a request
  • Resolves issue where duplicated requests couldn't be deleted or edited

Summary by cubic

Fixes a bug where duplicating a collection request reused the same backend request ID. We now drop the id on duplicate so the backend assigns a new ID and the copy can be edited, renamed, and deleted.

  • Bug Fixes
    • Strip id from duplicated REST and GraphQL requests before saving.
    • Confirmed delete/rename/edit works after reload for duplicated requests.

Written for commit f43a2ca5a9. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5781 **Author:** [@anwarulislam](https://github.com/anwarulislam) **Created:** 1/19/2026 **Status:** ✅ Merged **Merged:** 1/19/2026 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `fix/duplicate-request-issue` --- ### 📝 Commits (1) - [`f43a2ca`](https://github.com/hoppscotch/hoppscotch/commit/f43a2ca5a97f2edad8d8eff244a8ce1720af1b39) fix(common): prevent duplication of request ID when duplicating requests ### 📊 Changes **2 files changed** (+4 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/components/collections/graphql/index.vue` (+2 -1) 📝 `packages/hoppscotch-common/src/components/collections/index.vue` (+2 -1) </details> ### 📄 Description Closes FE-1115 ## Summary - Fix bug where duplicating a request in collections created a duplicate with the same backend request ID - This caused issues when logged in: duplicated requests couldn't be deleted, renamed, or edited - The fix removes the `id` field when duplicating, allowing the backend to generate a new unique ID ## Changes - Remove `id` field from request when duplicating (both REST and GraphQL) - This ensures each request has a unique backend ID - Backend correctly assigns new IDs for duplicated requests ## Testing - Login - Duplicate a request in collection → reload → delete works ✓ - Duplicate a request in collection → reload → rename works ✓ - Duplicate a request in collection → reload → edit works ✓ - Both REST and GraphQL requests fixed ✓ ## Related Issues - Resolves issue where original request disappeared after duplicating and renaming a request - Resolves issue where duplicated requests couldn't be deleted or edited <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes a bug where duplicating a collection request reused the same backend request ID. We now drop the id on duplicate so the backend assigns a new ID and the copy can be edited, renamed, and deleted. - **Bug Fixes** - Strip id from duplicated REST and GraphQL requests before saving. - Confirmed delete/rename/edit works after reload for duplicated requests. <sup>Written for commit f43a2ca5a97f2edad8d8eff244a8ce1720af1b39. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:48:15 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5346
No description provided.