mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #5913] [MERGED] fix(backend): prevent request payload from overriding id and name #5412
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#5412
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?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/5913
Author: @mirarifhasan
Created: 2/27/2026
Status: ✅ Merged
Merged: 3/2/2026
Merged by: @jamesgeorge007
Base:
patch← Head:hotfix/db-id-override📝 Commits (2)
1a48e37fix: cast and spread request before id and name18b0521test(backend): add tests forexportUserCollectionToJSONObjectid/name precedence📊 Changes
2 files changed (+68 additions, -2 deletions)
View changed files
📝
packages/hoppscotch-backend/src/user-collection/user-collection.service.spec.ts(+66 -0)📝
packages/hoppscotch-backend/src/user-collection/user-collection.service.ts(+2 -2)📄 Description
Closes BE-729.
What's changed
Reorder the spread in the request mapping so
idandnameare assigned after spreadingx.request, preventing the stored request JSON payload from overriding the authoritative DB row values and applied to both export paths inexportUserCollectionToJSONObjectandexportUserCollectionsToJSON.Also fixes constructor brace formatting and adds regression tests.
Notes to reviewers
exportUserCollectionToJSONObjectis called on every personal workspace page load and not only on explicit collection exports. Users who duplicated requests before the #5781 fix (v2026.1.1) have rows where the storedrequestJSON contains the original request'sid. Without this fix, the wrongidis served to the frontend on reload, causing delete/rename/edit operations to target the wrong row. This resolves the stuck-duplicate-after-upgrade regression reported postv2026.1.1.Summary by cubic
Fixes request mapping so a stored request payload can’t override id and name, ensuring correct identifiers in collection exports. Addresses BE-729.
Written for commit
18b05213e3. Summary will update on new commits.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.