{"record":{"id":"feaad736506b911e","repo":"qishibo/AnotherRedisDesktopManager","slug":"msg","errorCode":null,"errorMessage":"msg","messagePattern":"msg","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/components/DeleteBatch.vue","lineNumber":201,"sourceCode":"      }\n    },\n    afterDelete() {\n      this.loadingDelete = false;\n      this.allKeysList = [];\n\n      // empty the specified keys\n      // this.rule.key = [];\n\n      this.$message.success(this.$t('message.delete_success'));\n      this.$bus.$emit('refreshKeyList', this.client);\n\n      // except pattern mode scanning not to end, close pre tab\n      if (!this.rule.pattern.length || this.scanningEnd) {\n        this.$bus.$emit('removePreTab');\n      }\n    },\n    deleteFailed(msg = '') {\n      msg && this.$message.error(msg);\n\n      this.loadingScan = false;\n      this.loadingDelete = false;\n    },\n    initShortcut() {\n      this.$shortcut.bind('ctrl+r, ⌘+r, f5', this.hotKeyScope, () => {\n        this.initKeys();\n        return false;\n      });\n    },\n  },\n  mounted() {\n    this.initKeys();\n    // disable f5 for streams on event cannot stop\n    // this.initShortcut();\n  },\n  beforeDestroy() {\n    // this.$shortcut.deleteScope(this.hotKeyScope);","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/DeleteBatch.vue#L183-L219","documentation":"The shared failure sink of the batch-delete flow: deleteFailed(msg) shows the message and resets loadingScan/loadingDelete so the buttons unstick. It receives either the localized 'delete failed' (DEL replied 0) or a raw e.message from a rejected DEL — so the visible text identifies the upstream cause. With an empty msg it silently resets state only.","triggerScenarios":"Any failure in deleteKeys() routes here: DEL deleted nothing (reply 0), DEL rejected (connection/auth/readonly/cluster), or a caller passes '' to only reset the loading flags.","commonSituations":"Shared cleanup path after scan/delete failures; callers that just need the loading flags cleared.","solutions":["Differentiate the messages: 'no keys existed to delete' vs the raw command error, instead of one generic delete_failed string","Always call this (even with empty msg) after any delete-path failure so the UI never sticks in loading state","Trigger a re-scan after failure so the list reflects reality","Log the raw error alongside the localized text for diagnostics"],"exampleFix":"// before\ndeleteFailed(msg = '') {\n  msg && this.$message.error(msg);\n  this.loadingScan = false;\n  this.loadingDelete = false;\n},\n\n// after\ndeleteFailed(msg = '', raw = null) {\n  msg && this.$message.error({ message: msg, duration: 3000 });\n  raw && console.warn('[DeleteBatch]', raw);\n  this.loadingScan = false;\n  this.loadingDelete = false;\n},","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await delWork();\n} catch (e) {\n  this.deleteFailed(this.$t('message.delete_failed'), e);\n} finally {\n  this.loadingScan = false;\n  this.loadingDelete = false;\n}","preventionTips":["Centralize failure cleanup in one sink and always reset loading flags","Pass distinct messages for 'nothing deleted' vs command failure","Keep raw errors in logs for support","Re-scan after any delete failure to re-sync the list"],"tags":["redis","del","error-sink","ui-state","batch-delete"],"backgroundTag":"redis-del-command-failed","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}