{"record":{"id":"46427e9bf08f784d","repo":"qishibo/AnotherRedisDesktopManager","slug":"this-t-message-delete-failed-46427e","errorCode":null,"errorMessage":"this.$t('message.delete_failed')","messagePattern":"this\\.\\$t\\('message\\.delete_failed'\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/components/contents/KeyContentArray.vue","lineNumber":311,"sourceCode":"      }\n    },\n    deleteLine(row) {\n      this.$confirm(\n        this.$t('message.confirm_to_delete_row_data'),\n        { type: 'warning' },\n      ).then(() => {\n        this.client.call('ARDEL', this.redisKey, row.index).then((reply) => {\n          if (reply > 0) {\n            this.$message.success({\n              message: this.$t('message.delete_success'),\n              duration: 1000,\n            });\n\n            this.arrayData.splice(this.arrayData.indexOf(row), 1);\n            this.total--;\n            // this.initInfo();\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};\n</script>\n\n<style type=\"text/css\">\n</style>\n","sourceCodeStart":293,"sourceCodeEnd":328,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/contents/KeyContentArray.vue#L293-L328","documentation":"This is an application-level toast ('Deletion Failed') shown after client.call('ARDEL', key, index) resolves with reply <= 0 in KeyContentArray.vue. ARDEL (a custom array command registered in src/commands.js:135) succeeded at the protocol level but removed zero elements, meaning the index no longer pointed at a live element. The UI keeps the stale row because the success branch (splice + total--) is skipped.","triggerScenarios":"ARDEL key index returns 0 when the list shrank after the page was loaded (another client LPOP/RPOP/trimmed it), when the key was deleted or expired and recreated shorter, or when the row.index shown in the grid no longer matches server-side state after an earlier delete shifted indexes without a refresh (initShow is commented out, see the '// do not reinit, #786' pattern).","commonSituations":"Two operators editing the same list; CLI consumers draining the list while the GUI tab stays open; stale row indexes after deleting several elements in one session; key with a short TTL expiring between page load and row delete.","solutions":["Click refresh/reload the key view so row.index values are recomputed from current server state, then retry the delete","Verify the key still holds the expected length (ARLEN/LLEN) before deleting an indexed row","Check the key's TTL and type in the key header to confirm it was not recreated as a different/shorter array","If it reproduces consistently on every row, confirm the server actually implements AR* commands and that reply values are integers, not error strings handled elsewhere"],"exampleFix":"// before\nthis.client.call('ARDEL', this.redisKey, row.index).then((reply) => {\n  if (reply > 0) { /* success */ } else { this.$message.error(this.$t('message.delete_failed')); }\n});\n\n// after: verify index is still valid before deleting\nthis.client.call('ARLEN', this.redisKey).then((len) => {\n  if (Number(row.index) >= Number(len)) {\n    this.$message.warning(this.$t('message.delete_failed'));\n    return this.initShow();\n  }\n  return this.client.call('ARDEL', this.redisKey, row.index).then((reply) => {\n    if (reply > 0) { /* success */ }\n    else { this.$message.error(this.$t('message.delete_failed')); this.initShow(); }\n  });\n});","handlingStrategy":"validation","validationCode":"// before deleting row.index, confirm the array still covers it\nconst len = Number(await this.client.call('ARLEN', this.redisKey)) || 0;\nif (Number(row.index) >= len) {\n  this.$message.warning(this.$t('message.delete_failed'));\n  this.initShow(); // resync indexes\n  return;\n}\nawait this.client.call('ARDEL', this.redisKey, row.index);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Refresh the key view after other clients mutate the same list before deleting indexed rows","Treat reply==0 from ARDEL as 'row is stale' — resync with initShow instead of repeating the delete","Watch for the key being deleted/recreated (type + TTL badge) when deletes suddenly all fail"],"tags":["redis","list","stale-state","ui-toast","ardm"],"backgroundTag":"redis-write-no-op","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}