{"record":{"id":"9042726fc9f13b28","repo":"qishibo/AnotherRedisDesktopManager","slug":"this-t-message-delete-failed-904272","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/contents/KeyContentList.vue","lineNumber":279,"sourceCode":"        this.$t('message.confirm_to_delete_row_data'),\n        { type: 'warning' },\n      ).then(() => {\n        this.client.lrem(\n          this.redisKey,\n          1,\n          row.value,\n        ).then((reply) => {\n          if (reply > 0) {\n            this.$message.success({\n              message: this.$t('message.delete_success'),\n              duration: 1000,\n            });\n\n            // this.initShow(); // do not reinit, #786\n            this.listData.splice(this.listData.indexOf(row), 1);\n            this.total--;\n          } else {\n            this.$message.error({\n              message: this.$t('message.delete_failed'),\n              duration: 1000,\n            });\n          }\n        }).catch((e) => { this.$message.error(e.message); });\n      }).catch(() => {});\n    },\n  },\n  mounted() {\n    this.initShow();\n  },\n  beforeDestroy() {\n    this.cancelScanning = true;\n  },\n};\n</script>\n","sourceCodeStart":261,"sourceCodeEnd":296,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/contents/KeyContentList.vue#L261-L296","documentation":"deleteLine() calls client.lrem(redisKey, 1, row.value); LREM removes up to count occurrences matching the value and returns the number removed. The UI treats a reply of 0 as delete_failed: the exact value row.value was not present in the list (anymore), so nothing was removed and the table row is intentionally kept.","triggerScenarios":"LREM key 1 <value> returning 0: another client already removed or altered that exact value between rendering the table and the user confirming deletion; the row's displayed value differs byte-wise from what is stored (binary/encoding mismatch, so LREM finds no match); key flushed/recreated with different items.","commonSituations":"List is a shared work queue being consumed by workers (LPOP/RPOPLPOP) while a user deletes rows in the GUI; two sessions viewing the same key with one stale; values containing non-UTF8 bytes displayed with replacement characters — the copy sent to LREM never matches; deleting right after another admin's cleanup.","solutions":["Click reload on the key tab to resync the table; the row usually disappears on its own because it no longer exists server-side","If the row still shows after reload, suspect encoding: view the value in hex/binary mode and delete by index instead (LSET key index '' + LREM, or a transaction using LINDEX to verify bytes)","Coordinate with other clients/workers consuming the list so deletions don't race","Confirm you are connected to the same DB/node the key lives in (replica read-only views can show stale rows)"],"exampleFix":"// before: error toast only; stale row stays in the table\n} else {\n  this.$message.error({\n    message: this.$t('message.delete_failed'),\n    duration: 1000,\n  });\n}\n\n// after: a 0 reply means the value is already gone — resync and drop the stale row\n} else {\n  this.$message.warning({\n    message: this.$t('message.delete_failed'),\n    duration: 1000,\n  });\n  this.listData.splice(this.listData.indexOf(row), 1);\n  this.total--;\n}","handlingStrategy":"fallback","validationCode":"// verify the exact value still exists before asking LREM (Redis 6.2+)\nconst idx = await client.lpos(this.redisKey, row.value).catch(() => null);\nif (idx === null) {\n  // already gone server-side: just drop the stale row locally\n  this.listData.splice(this.listData.indexOf(row), 1);\n  this.total--;\n  return;\n}","typeGuard":"null","tryCatchPattern":"// treat a 0 reply as resync, not as a hard error\nclient.lrem(this.redisKey, 1, row.value).then((reply) => {\n  if (reply > 0) {\n    this.listData.splice(this.listData.indexOf(row), 1);\n    this.total--;\n  } else {\n    this.$message.warning('Value not found — refreshing');\n    this.resetTable();\n    this.initShow();\n  }\n}).catch((e) => this.$message.error(e.message));","preventionTips":["Refresh the tab before deleting rows in keys that other clients/workers mutate","When values are binary, verify bytes with LINDEX (hex view) rather than trusting the rendered text — LREM matches exact bytes","A delete_failed followed by reload usually resolves itself: the value is typically already gone","For queue keys, prefer deleting at a stable index via a verified MULTI/EXEC (LINDEX check + LSET/LREM) instead of by value"],"tags":["redis","list","lrem","value-not-found","stale-state","concurrency","vue"],"backgroundTag":"concurrent-modification-conflict","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}