{"record":{"id":"bac7e7ee1ba42d15","repo":"qishibo/AnotherRedisDesktopManager","slug":"this-t-message-group-exists-bac7e7","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/NewConnectionDialog.vue","lineNumber":326,"sourceCode":"  methods: {\n    loadGroups() {\n      this.groups = storage.getGroups();\n    },\n    openNewGroupDialog() {\n      this.newGroupName = '';\n      this.showGroupDialog = true;\n    },\n    handleNewGroup() {\n      const name = this.newGroupName.trim();\n\n      if (!name) {\n        return this.$message.error(this.$t('message.group_name_required'));\n      }\n\n      const group = storage.addGroup(name);\n\n      if (!group) {\n        return this.$message.error(this.$t('message.group_exists'));\n      }\n\n      this.loadGroups();\n      this.connection.groupId = group.id;\n\n      this.showGroupDialog = false;\n      this.$message.success(this.$t('message.add_success'));\n      this.$bus.$emit('groups-updated');\n    },\n    show() {\n      this.dialogVisible = true;\n      this.resetFields();\n      this.loadGroups();\n    },\n    resetFields() {\n      // edit connection mode\n      if (this.editMode) {\n        this.sshOptionsShow = !!this.config.sshOptions;","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/NewConnectionDialog.vue#L308-L344","documentation":"storage.addGroup returns false when an existing group has exactly the same name (groups.some(group => group.name === name) at src/storage.js:21); handleNewGroup maps that falsy return to this toast and skips loadGroups/groupId assignment. Uniqueness is exact, case-sensitive string equality over groups persisted in localStorage.","triggerScenarios":"Submitting a group name that matches an existing one character-for-character (e.g. adding 'prod' when 'prod' exists). 'Prod' vs 'prod' are different names and both are allowed.","commonSituations":"Re-adding a group after reinstalling the app or re-importing connections; forgetting a group was created earlier in another connection dialog; expecting case-insensitive uniqueness.","solutions":["Choose a different group name","Rename or delete the existing group from the Connections page first, then re-add","Pre-check with storage.getGroups().some(g => g.name === name) and surface inline feedback before submit"],"exampleFix":"// before\nconst group = storage.addGroup(name);\nif (!group) {\n  return this.$message.error(this.$t('message.group_exists'));\n}\n\n// after - pre-check for inline feedback before even opening submit\nconst name = this.newGroupName.trim();\nif (storage.getGroups().some(g => g.name === name)) {\n  return this.$message.warning(`group \"${name}\" already exists`);\n}","handlingStrategy":"validation","validationCode":"// pre-check before calling storage.addGroup\nimport storage from '@/storage.js';\n\nfunction groupExists(name) {\n  return storage.getGroups().some(g => g.name === name);\n}\n\nconst name = raw.trim();\nif (groupExists(name)) {\n  highlightExistingGroup(name);\n  return;\n}\nconst group = storage.addGroup(name);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember uniqueness is exact and case-sensitive: 'Prod' and 'prod' coexist","List existing groups (storage.getGroups()) before offering a creation UI","Consider suffixing re-imported groups instead of re-adding with the same name"],"tags":["vue","localstorage","duplicate-entry","ardm"],"backgroundTag":"duplicate-entry","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}