qishibo/AnotherRedisDesktopManager · warning

this.$t('message.value_exists')

Error message

this.$t('message.value_exists')

What it means

Application-level toast ('Value Already Exists') in KeyContentSet.vue:249. SADD resolved successfully but reply == 0: Redis reports the number of members actually added, so 0 means every submitted member was already present. This is a semantic conflict, not a transport or protocol failure — nothing was written and the set is unchanged.

Source

Thrown at src/components/contents/KeyContentSet.vue:249

          // edit line
          if (before.value) {
            this.$set(this.setData, this.setData.indexOf(before), newLine);
          }
          // new line
          else {
            this.setData.push(newLine);
            this.total++;
          }

          this.$message.success({
            message: this.$t('message.add_success'),
            duration: 1000,
          });
        }

        // value exists
        else if (reply == 0) {
          this.$message.error({
            message: this.$t('message.value_exists'),
            duration: 1000,
          });
        }
      }).catch((e) => { this.$message.error(e.message); });
    },
    deleteLine(row) {
      this.$confirm(
        this.$t('message.confirm_to_delete_row_data'),
        { type: 'warning' },
      ).then(() => {
        this.client.srem(
          this.redisKey,
          row.value,
        ).then((reply) => {
          if (reply == 1) {
            this.$message.success({
              message: this.$t('message.delete_success'),

View on GitHub (pinned to c149855106)

Solutions

  1. Treat as expected behavior for sets: search the current page (or SISMEMBER in console) to confirm the member is present
  2. Clear the filter and reload the key so the existing member becomes visible
  3. If the duplicate is unintended, edit the value first so the member differs before saving
  4. Guard the save button against double-submits to avoid confusing repeats

Example fix

// before
this.client.sadd(this.redisKey, value).then((reply) => {
  if (reply > 0) { /* added */ }
  else if (reply == 0) { this.$message.error(this.$t('message.value_exists')); }
});

// after: pre-check to give a precise message and keep dialog contents
const exists = await this.client.sismember(this.redisKey, value);
if (exists) {
  this.$message.warning(this.$t('message.value_exists'));
  return;
}
Defensive patterns

Strategy: validation

Validate before calling

// SISMEMBER before SADD to get a precise duplicate warning
const member = value; // Buffer or string exactly as SADD would send it
const exists = await this.client.sismember(this.redisKey, member);
if (exists) {
  this.$message.warning(this.$t('message.value_exists'));
  return;
}
await this.client.sadd(this.redisKey, member);

Prevention

When it happens

Trigger: SADD key member returns 0 when the exact member bytes already exist: re-adding a row visible in the current page, adding a member another operator just inserted, whitespace/case-identical duplicates, or submitting the dialog twice (double-click on save).

Common situations: Duplicate suppression workflows where the GUI is used to re-insert known tags/ids; two users curating the same set; stale page showing the member as absent after a filter.

Related errors


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