{"record":{"id":"c624f5c6b41035cc","repo":"qishibo/AnotherRedisDesktopManager","slug":"this-t-message-group-exists","errorCode":null,"errorMessage":"this.$t('message.group_exists')","messagePattern":"this\\.\\$t\\('message\\.group_exists'\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/components/Connections.vue","lineNumber":253,"sourceCode":"\n      const groups = [...this.groups];\n      groups.splice(newIndex, 0, groups.splice(oldIndex, 1)[0]);\n      this.groups = groups;\n      storage.setGroups(groups);\n    },\n    openEditGroupDialog(group) {\n      this.groupForm = { id: group.id, name: group.name };\n      this.showGroupDialog = true;\n    },\n    handleGroupSubmit() {\n      const name = this.groupForm.name.trim();\n\n      if (!name) {\n        return this.$message.error(this.$t('message.group_name_required'));\n      }\n\n      if (!storage.renameGroup(this.groupForm.id, name)) {\n        return this.$message.error(this.$t('message.group_exists'));\n      }\n\n      this.showGroupDialog = false;\n      this.$message.success(this.$t('message.modify_success'));\n      this.$bus.$emit('groups-updated');\n    },\n    deleteGroup(groupId) {\n      this.$confirm(this.$t('message.delete_group_confirm'), { type: 'warning' }).then(() => {\n        storage.deleteGroup(groupId);\n        this.$message.success(this.$t('message.delete_success'));\n        // reload connections so in-memory groupId is cleared(in connections)\n        this.initConnections();\n      }).catch(() => {});\n    },\n    initGroups() {\n      this.groups = storage.getGroups();\n      this.initSortable();\n    },","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/Connections.vue#L235-L271","documentation":"Element UI toast shown when storage.renameGroup(groupForm.id, name) returns false. Per src/storage.js:31-41, renameGroup returns false in three cases: id is falsy, name is falsy, the target group id no longer exists in storage, or another group already has the requested name (groups.some(group => group.name === name)). Since the empty-name case is handled by the previous guard, this message in practice means 'a group with this name already exists' (or the group was deleted in another window between opening the dialog and submitting).","triggerScenarios":"Opening the edit-group dialog and renaming a group to a name that another saved group already uses; renaming group A to 'default' when group B is already named 'default'; submitting the dialog after the group was deleted concurrently elsewhere so groups.find(id) misses.","commonSituations":"Reorganizing many similarly-named groups (prod/staging/dev) and hitting a duplicate; syncing connections between two app instances where one instance already created the target name; stale dialog left open after the group was removed elsewhere.","solutions":["Choose a unique group name that no existing group uses","Before submitting, check for duplicates: list groups via the connections sidebar and verify the target name is free","Make renameGroup idempotent by allowing same-name (skip the duplicate check when group.name === name for the same id)","If the error persists with a seemingly fresh name, reload connections (the group list may be stale) and retry"],"exampleFix":"// storage.js - allow keeping the same name on rename\nif (groups.some(group => group.name === name && group.id !== id)) {\n  return false;\n}","handlingStrategy":"validation","validationCode":"const name = this.groupForm.name.trim();\nconst groups = this.$store.state.groups || storage.getGroups();\nconst duplicate = groups.some(g => g.name === name && g.id !== this.groupForm.id);\nif (duplicate) {\n  this.$message.error(this.$t('message.group_exists'));\n  return;\n}","typeGuard":"const isNameFree = (groups, name, ownId) =>\n  !groups.some(g => g.name === name && g.id !== ownId);","tryCatchPattern":null,"preventionTips":["Pre-check uniqueness in the dialog before submit and disable confirm on duplicates","Allow same-id same-name submits (no-op renames) to reduce false errors","Reload the group list when the dialog opens so the duplicate check runs against fresh data"],"tags":["ui-validation","duplicate-key","i18n","vue","connection-groups"],"backgroundTag":"duplicate-name-confirmation","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}