mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #1148] hoppscotch empties the collections by itself #399
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#399
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 @ravieze on GitHub (Sep 7, 2020).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1148
Describe the bug
Expected behavior
The collections should stay as they are. They shouldnt be emptied.
Screenshots

Desktop (please complete the following information):
@liyasthomas commented on GitHub (Sep 7, 2020):
I can't reproduce this issue. Can you check with your team mates that none of them accidently deleted those saved requests?
@ravieze commented on GitHub (Sep 7, 2020):
Actually me and 1 more colleague login with same gmail account credentials. After I had imported we both refreshed the pages, the collection entries remained intact for a while and then they all disappeared. we tried this couple of times, and it was consistently reproducible.
Not sure if this can be of some help, but this is all the ifo i have / i can share
@liyasthomas commented on GitHub (Sep 7, 2020):
I tried to reproduce this situation with two incognito windows, but had no issue. Will try more cases now.
@ravieze commented on GitHub (Sep 7, 2020):
Make sure that each window has multipe Gmail accounts in it. Not sure if this can be an issue. But in my case we did have multiple gmail accounts. Also, when u import the collection does it happen in background, in async?
@liyasthomas commented on GitHub (Sep 27, 2020):
Not reproducible, hence closing.
@vinayakavaradaraj commented on GitHub (Nov 5, 2020):
As @ravieze mentioned, collections are emptied when we have a high latency or slow internet connection.
Steps to reproduce issue
Hence issue reproduced.
@gabrielenosso commented on GitHub (Mar 24, 2021):
I had the same experience, logging in from 2 different instances of Chrome.
Lost all my data... Luckily I had a very recent backup.
@liyasthomas commented on GitHub (Mar 24, 2021):
Sorry for that incident. We're working on a fully refactored state system along with better synchronisation on cloud. We'll keep an eye out on this very particular edge case and make sure it'll be resolved in upcoming days.
@dovwatbnh commented on GitHub (Jan 16, 2024):
I have this same issue. Very unfortunate. I tried to use a normal account using a magic link to log in, but I guess it was still tied to my Google account? After a couple seconds after importing an Insomnia export, it all gets deleted.
Turning off all sync features fixes it
@dovwatbnh commented on GitHub (Jan 17, 2024):
After rebooting my PC, everything was deleted once again... Even with sync off. I tried using a new account which wasn't linked to a Google account in Hoppscotch, and it was still deleted after a couple seconds after import.
I think the issue is most likely the fact that I do an Insomnia import.
Maybe the fact that I'm on a restricted company network with a MITM proxy is causing issues?
@abbychau commented on GitHub (Apr 12, 2024):
It happened to my colleague today again!
@ARE2KUSU commented on GitHub (Apr 16, 2024):
I got the same issue than @dovwatbnh but after a postman import, everything got deleted after a while
@suiramdev commented on GitHub (Apr 11, 2025):
Same issue when importing a postman collection... This should be re-opened.
@suiramdev commented on GitHub (Apr 11, 2025):
@ravieze commented on GitHub (Jun 4, 2025):
i moved away from postman, hoppscotch.
now i use: HTTPYAC : https://httpyac.github.io/guide/installation_vscode.html ( very beautiful vscode plugin )
definiing placeholders:
@bernatGene commented on GitHub (Oct 20, 2025):
Same issue, even without importing anything. Created directly items in a collection (in the desktop app), still had the browser version opened too.
After some time of doing other things. I come back and my collection is empty except for a single request.
The rest are still opened in the tabs, and saving says "saved" but still do not appear in the collections sidebar??
@TOHUHM commented on GitHub (Nov 11, 2025):
same issue, I don't even believe my eyes and try again and again, but the collection keep being empty, any solution?
@liyasthomas commented on GitHub (Nov 11, 2025):
Have you noticed any error messages or toast notifications? You might also want to check the browser console.
@TOHUHM commented on GitHub (Nov 11, 2025):
No error message, the request disappeared just when I right click and "reload"
yes, It happened on my desktop version, I tried to create new request on browser console, it's normal and synced to my desktop version fast, Any sync logic I need to change?
@ankurmalhotra07 commented on GitHub (Nov 11, 2025):
We had multiple users complain about this exact issue where collections were getting deleted after a day.
@TOHUHM commented on GitHub (Nov 11, 2025):
seem it keep sync with remote data and override any local changes.
@liyasthomas commented on GitHub (Nov 11, 2025):
I need a few more details.
@TOHUHM commented on GitHub (Nov 11, 2025):
https://hopp.sh/r/z7fvnsnZ5ayi
@ankurmalhotra07 commented on GitHub (Nov 11, 2025):
We’re observing issues with both the desktop and browser versions. Collections are being imported from Postman, but the issue appears intermittently. We’re in the process of gathering more logs, but wanted to flag a potential contributing factor.
It looks like the createCollection method is acquiring a lock on the entire UserCollection table here
This could be problematic, as a full table lock is likely to cause timeouts and possible deadlocks under concurrent or mixed workloads.
@TOHUHM commented on GitHub (Nov 11, 2025):
ignore this guess, I tried to create request from web browser, issue happened too, seems linked to specific request
@shaezard commented on GitHub (Nov 11, 2025):
We found following scalability issues with the current backend implementation for Create/Update/Delete operations on UserRequest, UserCollection, TeamRequest, TeamCollection
FULL EXCLUSIVE TABLE LOCK while modification operations:-
Possible Deadlocks patterns:-
// This pattern might be causing deadlocks:
// User Request 1:
await prisma.lockTableExclusive(tx, 'UserCollection'); // Locks UserCollection
// ... then might try to lock UserRequest
// User Request 2 (simultaneously):
await prisma.lockTableExclusive(tx, 'UserRequest'); // Locks UserRequest
// ... then might try to lock UserCollection
// Result: DEADLOCK! One transaction is killed
The 69 deadlocks prove we need to refactor ASAP.
Option 1 : Replace table locks with row-level locks (using FOR UPDATE)
Option 2 : Migrate to sequence-based ordering (using PostGres Sequences)
@mirarifhasan commented on GitHub (Nov 11, 2025):
If anyone has backend logs showing DB deadlock errors or failed creation attempts, please share them so we can debug further.
@shaezard commented on GitHub (Nov 11, 2025):
We saw one more issue due to which the collections are getting lost on relogin.
When postman collections are imported to the Personal workspace, they are stored in the local storage and then synced to the database asynchronously. This makes the changes in the personal collection appear instantaneously on the UI. But sometimes the DB sync fails due to some validation errors like:-
titleis missingBackend Server | Argumenttitleis missing. Backend Server | at /dist/backend/dist/team-collection/team-collection.service.js:141:27 Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120) Backend Server | at async TeamCollectionService.importCollectionsFromJSON (/dist/backend/dist/team-collection/team-collection.service.js:125:13) Backend Server | at async TeamCollectionResolver.importCollectionsFromJSON (/dist/backend/dist/team-collection/team-collection.resolver.js:85:36) { Backend Server | response: PrismaClientValidationError: Backend Server | Invalidtx.teamCollection.create()invocation in Backend Server | /dist/backend/dist/team-collection/team-collection.service.js:135:81 Backend Server | Backend Server | 132 }); Backend Server | 133 let lastOrderIndex = lastEntry ? lastEntry.orderIndex : 0; Backend Server | 134 queryList = collectionsList.right.map((x) => this.generatePrismaQueryObjForFBCollFolder(x, teamID, ++lastOrderIndex)); Backend Server | → 135 const promises = queryList.map((query) => tx.teamCollection.create({ Backend Server | data: { Backend Server | title: "## DBILL-9213: Data_Fix_Script_For_Primary_Contact_Missing_In_Account ## Copy", Backend Server | team: { Backend Server | connect: { Backend Server | id: "cmhsmclxf04a86d2jyydiba6e" Backend Server | } Backend Server | }Due to these validation errors, the db sync fails and when the user logs in again, the local storage is overridden by the data in database resulting in the loss of collections for which the db sync failed.
@shaezard commented on GitHub (Nov 13, 2025):
Here are the backend logs showing error due to deadlock. The requests might have eventually succeeded due to retries but Having a full exclusive lock certainly affects the latency of the request
1. UserRequestService.createRequest
Backend Server | Error from UserRequestService.createRequest ConflictException:
Backend Server | Invalid
prisma.$executeRaw()invocation:Backend Server |
Backend Server |
Backend Server | Raw query failed. Code:
40P01. Message:ERROR: deadlock detected Backend Server | DETAIL: Process 20091 waits for ExclusiveLock on relation 20747 of database 20621; blocked by process 25039. Backend Server | Process 25039 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18248. Backend Server | Process 18248 waits for RowShareLock on relation 20747 of database 20621; blocked by process 20091. Backend Server | HINT: See server log for query details.Backend Server | at /dist/backend/dist/user-request/user-request.service.js:93:27
Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120)
Backend Server | at async UserRequestService.createRequest (/dist/backend/dist/user-request/user-request.service.js:74:26)
Backend Server | at async UserRequestResolver.createRESTUserRequest (/dist/backend/dist/user-request/resolvers/user-request.resolver.js:57:25) {
Backend Server | response: PrismaClientKnownRequestError:
Backend Server | Invalid
prisma.$executeRaw()invocation:Backend Server |
Backend Server |
Backend Server | Raw query failed. Code:
40P01. Message:ERROR: deadlock detected Backend Server | DETAIL: Process 20091 waits for ExclusiveLock on relation 20747 of database 20621; blocked by process 25039. Backend Server | Process 25039 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18248. Backend Server | Process 18248 waits for RowShareLock on relation 20747 of database 20621; blocked by process 20091. Backend Server | HINT: See server log for query details.Backend Server | at ei.handleRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:7283)
Backend Server | at ei.handleAndLogRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6608)
Backend Server | at ei.request (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6315)
Backend Server | at async a (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:9551)
Backend Server | at async /dist/backend/dist/user-request/user-request.service.js:76:21
Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120)
Backend Server | at async UserRequestService.createRequest (/dist/backend/dist/user-request/user-request.service.js:74:26)
Backend Server | at async UserRequestResolver.createRESTUserRequest (/dist/backend/dist/user-request/resolvers/user-request.resolver.js:57:25) {
Backend Server | code: 'P2010',
Backend Server | meta: {
Backend Server | code: '40P01',
Backend Server | message: 'ERROR: deadlock detected\n' +
Backend Server | 'DETAIL: Process 20091 waits for ExclusiveLock on relation 20747 of database 20621; blocked by process 25039.\n' +
Backend Server | 'Process 25039 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18248.\n' +
Backend Server | 'Process 18248 waits for RowShareLock on relation 20747 of database 20621; blocked by process 20091.\n' +
Backend Server | 'HINT: See server log for query details.'
Backend Server | },
Backend Server | clientVersion: '6.14.0'
Backend Server | },
Backend Server | status: 409,
Backend Server | options: {}
Backend Server | }
2. UserCollectionService.updateOrderIndex
Backend Server | ::1 POST /graphql 200 - 0.927 ms
Backend Server | Error from UserCollectionService.updateOrderIndex: ConflictException:
Backend Server | Invalid
tx.userCollection.delete()invocation inBackend Server | /dist/backend/dist/user-collection/user-collection.service.js:310:55
Backend Server |
Backend Server | 307 await this.prisma.$transaction(async (tx) => {
Backend Server | 308 try {
Backend Server | 309 await this.prisma.lockTableExclusive(tx, 'UserCollection');
Backend Server | → 310 await tx.userCollection.delete(
Backend Server | Error occurred during query execution:
Backend Server | ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "40P01", message: "deadlock detected", severity: "ERROR", detail: Some("Process 11516 waits for RowShareLock on relation 20747 of database 20621; blocked by process 3404.\nProcess 3404 waits for RowShareLock on relation 20755 of database 20621; blocked by process 11516."), column: None, hint: Some("See server log for query details.") }), transient: false })
Backend Server | at /dist/backend/dist/user-collection/user-collection.service.js:322:31
Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120)
Backend Server | at async UserCollectionService.removeCollectionAndUpdateSiblingsOrderIndex (/dist/backend/dist/user-collection/user-collection.service.js:307:17)
Backend Server | at async UserCollectionService.deleteCollectionData (/dist/backend/dist/user-collection/user-collection.service.js:227:27)
Backend Server | at async UserCollectionService.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.service.js:242:32)
Backend Server | at async UserCollectionResolver.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.resolver.js:105:24) {
Backend Server | response: PrismaClientUnknownRequestError:
Backend Server | Invalid
tx.userCollection.delete()invocation inBackend Server | /dist/backend/dist/user-collection/user-collection.service.js:310:55
Backend Server |
Backend Server | 307 await this.prisma.$transaction(async (tx) => {
Backend Server | 308 try {
Backend Server | 309 await this.prisma.lockTableExclusive(tx, 'UserCollection');
Backend Server | → 310 await tx.userCollection.delete(
Backend Server | Error occurred during query execution:
Backend Server | ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "40P01", message: "deadlock detected", severity: "ERROR", detail: Some("Process 11516 waits for RowShareLock on relation 20747 of database 20621; blocked by process 3404.\nProcess 3404 waits for RowShareLock on relation 20755 of database 20621; blocked by process 11516."), column: None, hint: Some("See server log for query details.") }), transient: false })
Backend Server | at ei.handleRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:7473)
Backend Server | at ei.handleAndLogRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6608)
Backend Server | at ei.request (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6315)
Backend Server | at async a (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:9551)
Backend Server | at async /dist/backend/dist/user-collection/user-collection.service.js:310:25
Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120)
Backend Server | at async UserCollectionService.removeCollectionAndUpdateSiblingsOrderIndex (/dist/backend/dist/user-collection/user-collection.service.js:307:17)
Backend Server | at async UserCollectionService.deleteCollectionData (/dist/backend/dist/user-collection/user-collection.service.js:227:27)
Backend Server | at async UserCollectionService.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.service.js:242:32)
Backend Server | at async UserCollectionResolver.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.resolver.js:105:24) {
Backend Server | clientVersion: '6.14.0'
Backend Server | },
Backend Server | status: 409,
Backend Server | options: {}
Backend Server | }
3. UserCollectionService.deleteUserCollection
Backend Server |
Backend Server | Raw query failed. Code:
40P01. Message:ERROR: deadlock detected Backend Server | DETAIL: Process 18072 waits for ExclusiveLock on relation 20755 of database 20621; blocked by process 18067. Backend Server | Process 18067 waits for RowShareLock on relation 20747 of database 20621; blocked by process 26123. Backend Server | Process 26123 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18072. Backend Server | HINT: See server log for query details.Backend Server | at ei.handleRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:7283)
Backend Server | at ei.handleAndLogRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6608)
Backend Server | at ei.request (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6315)
Backend Server | at async a (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:9551)
Backend Server | at async /dist/backend/dist/user-collection/user-collection.service.js:309:25
Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120)
Backend Server | at async UserCollectionService.removeCollectionAndUpdateSiblingsOrderIndex (/dist/backend/dist/user-collection/user-collection.service.js:307:17)
Backend Server | at async UserCollectionService.deleteCollectionData (/dist/backend/dist/user-collection/user-collection.service.js:227:27)
Backend Server | at async UserCollectionService.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.service.js:242:32)
Backend Server | at async Promise.all (index 0) {
Backend Server | code: 'P2010',
Backend Server | meta: {
Backend Server | code: '40P01',
Backend Server | message: 'ERROR: deadlock detected\n' +
Backend Server | 'DETAIL: Process 18072 waits for ExclusiveLock on relation 20755 of database 20621; blocked by process 18067.\n' +
Backend Server | 'Process 18067 waits for RowShareLock on relation 20747 of database 20621; blocked by process 26123.\n' +
Backend Server | 'Process 26123 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18072.\n' +
Backend Server | 'HINT: See server log for query details.'
Backend Server | },
Backend Server | clientVersion: '6.14.0'
Backend Server | },
Backend Server | status: 409,
Backend Server | options: {}
Backend Server | }