{"record":{"id":"1dcfe11182a15b9b","repo":"qishibo/AnotherRedisDesktopManager","slug":"this-t-message-delete-failed-1dcfe1","errorCode":null,"errorMessage":"this.$t('message.delete_failed')","messagePattern":"this\\.\\$t\\('message\\.delete_failed'\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/components/DeleteBatch.vue","lineNumber":159,"sourceCode":"        for (let i = 0; i < total; i++) {\n          chunked.push(keys[i].key);\n\n          // del 5000 keys one time\n          if (chunked.length >= 5000) {\n            delPromise = this.client.del(chunked);\n            chunked = [];\n          }\n        }\n\n        if (chunked.length) {\n          delPromise = this.client.del(chunked);\n        }\n        // use final promise\n        delPromise.then((reply) => {\n          if (reply > 0) {\n            this.afterDelete();\n          } else {\n            this.deleteFailed(this.$t('message.delete_failed'));\n          }\n        }).catch((e) => {\n          this.deleteFailed(e.message);\n        });\n      }\n\n      // cluster, one key per time instead of batch\n      else {\n        for (let i = 0; i < total; i++) {\n          delPromise = this.client.del(keys[i].key);\n          delPromise.catch((e) => {});\n        }\n\n        // use final promise\n        delPromise.then((reply) => {\n          if (reply == 1) {\n            this.afterDelete();\n          } else {","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/DeleteBatch.vue#L141-L177","documentation":"Not a thrown error: the non-cluster DEL (client.del(chunked)) resolved, but the reply was 0 — none of the submitted keys existed at delete time. Keys can vanish between the SCAN and the DEL (TTL expiry, another client deleting), or the wrong DB is targeted. The app routes this to deleteFailed with the localized 'delete failed' message.","triggerScenarios":"Keys with short TTLs expiring while the scan dialog is open; another session or CLI deleting the same keys; keys scanned from a different DB than the DEL runs against.","commonSituations":"Cleanup racing with expiring sessions/locks, two operators cleaning the same keyspace, tools scanning db0 while the client switched DBs.","solutions":["Treat a 0 reply as 'already gone' (info-level) instead of a hard failure","Re-scan to refresh the key list right before deleting","Confirm the correct DB/connection is selected for both scan and delete","Check TTLs on the target keys before batch-deleting volatile keys"],"exampleFix":"// before\ndelPromise.then((reply) => {\n  if (reply > 0) { this.afterDelete(); }\n  else { this.deleteFailed(this.$t('message.delete_failed')); }\n});\n\n// after\ndelPromise.then((reply) => {\n  if (reply > 0) { this.afterDelete(); }\n  else {\n    // keys vanished before DEL ran: end state is what the user wanted\n    this.$message.info(this.$t('message.already_deleted'));\n    this.afterDelete();\n  }\n});","handlingStrategy":"validation","validationCode":"// prune keys that no longer exist before issuing DEL\nconst existing = await this.client.exists(...chunked);\nif (existing === 0) {\n  this.afterDelete();\n  return;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Interpret DEL's numeric reply: it counts keys actually removed","Refresh/re-scan immediately before delete","Align DB selection between scan and delete","Treat 0 as success when the goal is 'key must not exist' (idempotent delete)"],"tags":["redis","del","expired-keys","batch-delete"],"backgroundTag":"redis-key-not-found","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}