Skip to content

[Bug]: Project creation accepts a one-character key that project settings reject #1436

Description

@thriz0

Bug Description

The New Project modal allows a project to be created with a one-character Key (for example, A).

After the project has been created, opening Project Settings > General and changing another field, such as the project icon, fails because the existing key is rejected with a validation error stating that the key must contain at least two characters.

The project creation modal and the project settings page therefore enforce different validation rules for the same field. This also leaves the project in a state where unrelated settings cannot be saved without first changing its key.

Steps To Reproduce

  1. Open a workspace.
  2. Open the New Project modal.
  3. Enter a project name.
  4. Enter a one-character key, for example A.
  5. Click Create Project.
  6. Open the newly created project's Settings > General page.
  7. Change another setting, such as the project icon.
  8. Attempt to save the change.

Expected Behavior

The Key field should use the same validation rules during project creation and project editing.

If project keys must contain between 2 and 8 characters, the creation modal should reject a one-character key and display the validation error before the project is created.

Actual result

The creation modal accepts and persists a one-character project key, but the project settings form subsequently considers that same key invalid and prevents settings from being saved.

Screenshots

No response

Environment

  • Kaneo Version : 2.9.8

Additional Context

This inconsistency is also present on the current main branch:

  • The creation modal only requires a non-empty key and sets a maximum length of 8 characters.
  • The project settings form requires the key to contain between 2 and 8 characters.
  • The API schemas currently accept any string length for the key.

Using the same shared validation rules for project creation, project editing, and the API would prevent these paths from drifting apart and would stop invalid project keys from being persisted.

Related but distinct issue: #875 — Project Key input lacks character limit/overflow handling addressed excessively long keys, not the inconsistent minimum length.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions