{"record":{"id":"92664df58447a076","repo":"qishibo/AnotherRedisDesktopManager","slug":"this-t-message-delete-failed","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/KeyListVirtualTree.vue","lineNumber":235,"sourceCode":"        // del single key[\"delete\" in the key right menu]\n        case 'delete': {\n          // del batch instead of single when multi operating\n          if (this.multiOperating) {\n            return this.deleteBatch();\n          }\n\n          const keyBuffer = Buffer.from(this.rightClickNode.data.nameBuffer.data);\n\n          this.client.del(keyBuffer).then((reply) => {\n            if (reply == 1) {\n              this.$message.success({\n                message: this.$t('message.delete_success'),\n                duration: 1000,\n              });\n\n              this.$bus.$emit('refreshKeyList', this.client, keyBuffer, 'del');\n            } else {\n              this.$message.error(this.$t('message.delete_failed'));\n            }\n          }).catch((e) => { this.$message.error(e.message); });\n          break;\n        }\n        // select multiple\n        case 'multiple_select': {\n          this.showMultiSelect();\n          break;\n        }\n        // open key in new tab\n        case 'open': {\n          this.clickKey(Buffer.from(this.rightClickNode.data.nameBuffer.data), true);\n          break;\n        }\n        // delete whole folder\n        case 'delete_folder': {\n          const rule = { pattern: [this.rightClickNode.data.fullName] };\n          this.$bus.$emit('openDelBatch', this.client, this.config.connectionName, rule);","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/KeyListVirtualTree.vue#L217-L253","documentation":"After DEL on a tree node in KeyListVirtualTree.vue, Redis replies with the number of keys actually removed; reply != 1 means the key did not exist server-side anymore (expired or deleted elsewhere between view and click), so the localized delete_failed toast is shown. The DEL command itself succeeded - it simply removed nothing.","triggerScenarios":"Key expired (had a TTL) while the tree node was still visible; the key was deleted by another client or a second GUI session; stale tree node left after a missed refresh.","commonSituations":"Two sessions open on the same DB; short-TTL keys disappearing during browsing; cluster failover repartitioning keys away from the scanned node.","solutions":["Refresh the key list/tree - the stale node disappears.","Optionally confirm with EXISTS in the CLI tab if unsure whether the key is really gone.","No data risk: if the key still exists after refresh, delete it again from the refreshed list."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// optional existence check right before delete\nconst exists = await client.exists(keyBuffer);\nif (!exists) { removeNodeFromTree(); return; }","typeGuard":"const wasDeleted = (reply) => reply === 1; // DEL returns the count actually removed","tryCatchPattern":"this.client.del(keyBuffer).then((reply) => {\n  if (wasDeleted(reply)) success();\n  else {\n    // key vanished server-side: treat as stale view, not as an error\n    this.$message.warning('Key already gone - refreshing');\n    this.$bus.$emit('refreshKeyList', this.client);\n  }\n});","preventionTips":["Interpret DEL reply 0 as 'already deleted' (refresh the view) rather than an error.","Remember TTL keys can expire between view and action - refresh before destructive clicks on stale nodes."],"tags":["del","key-not-found","race-condition","stale-view"],"backgroundTag":"redis-key-not-found","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}