qishibo/AnotherRedisDesktopManager · error

this.$t('message.delete_failed')

Error message

this.$t('message.delete_failed')

What it means

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.

Source

Thrown at src/components/contents/KeyContentArray.vue:311

      }
    },
    deleteLine(row) {
      this.$confirm(
        this.$t('message.confirm_to_delete_row_data'),
        { type: 'warning' },
      ).then(() => {
        this.client.call('ARDEL', this.redisKey, row.index).then((reply) => {
          if (reply > 0) {
            this.$message.success({
              message: this.$t('message.delete_success'),
              duration: 1000,
            });

            this.arrayData.splice(this.arrayData.indexOf(row), 1);
            this.total--;
            // this.initInfo();
          } else {
            this.$message.error({
              message: this.$t('message.delete_failed'),
              duration: 1000,
            });
          }
        }).catch((e) => { this.$message.error(e.message); });
      }).catch(() => {});
    },
  },
  mounted() {
    this.initShow();
  },
};
</script>

<style type="text/css">
</style>

View on GitHub (pinned to c149855106)

Solutions

  1. Click refresh/reload the key view so row.index values are recomputed from current server state, then retry the delete
  2. Verify the key still holds the expected length (ARLEN/LLEN) before deleting an indexed row
  3. Check the key's TTL and type in the key header to confirm it was not recreated as a different/shorter array
  4. 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

Example fix

// before
this.client.call('ARDEL', this.redisKey, row.index).then((reply) => {
  if (reply > 0) { /* success */ } else { this.$message.error(this.$t('message.delete_failed')); }
});

// after: verify index is still valid before deleting
this.client.call('ARLEN', this.redisKey).then((len) => {
  if (Number(row.index) >= Number(len)) {
    this.$message.warning(this.$t('message.delete_failed'));
    return this.initShow();
  }
  return this.client.call('ARDEL', this.redisKey, row.index).then((reply) => {
    if (reply > 0) { /* success */ }
    else { this.$message.error(this.$t('message.delete_failed')); this.initShow(); }
  });
});
Defensive patterns

Strategy: validation

Validate before calling

// before deleting row.index, confirm the array still covers it
const len = Number(await this.client.call('ARLEN', this.redisKey)) || 0;
if (Number(row.index) >= len) {
  this.$message.warning(this.$t('message.delete_failed'));
  this.initShow(); // resync indexes
  return;
}
await this.client.call('ARDEL', this.redisKey, row.index);

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of qishibo/AnotherRedisDesktopManager@c149855106 (2026-08-22). Data as JSON: /api/errors/46427e9bf08f784d. Report an issue: GitHub.