Skip to content

fix(apps): align app name limit to 64 chars - #1048

Open
rohan-chaturvedi wants to merge 1 commit into
mainfrom
ccr-0b60cd92-cvhafb
Open

rohan-chaturvedi wants to merge 1 commit into
mainfrom
ccr-0b60cd92-cvhafb

Conversation

@rohan-chaturvedi

Copy link
Copy Markdown
Member

🔍 Overview

App name limits were inconsistent:

Where Before
Console create app dialog 32 (shared MAX_INPUT_STRING_LENGTH)
Console app settings rename 64
App.name column 64
REST POST /v1/apps/, PUT /v1/apps/<id>/ 64
GraphQL updateAppInfo 64
GraphQL createApp no check
Public API docs 64

createApp accepted blank names, and names over 64 chars failed at the database instead of returning a clear error.

💡 Proposed Changes

  • Console: new MAX_APP_NAME_LENGTH = 64, used by the create dialog and the settings rename input. MAX_INPUT_STRING_LENGTH (32) is unchanged for its other uses (team name in onboarding).
  • createApp: reject blank names and names over 64 chars, with the same checks and messages as updateAppInfo.

No REST API, model or docs changes: they already use 64.

🖼️ Screenshots or Demo

N/A

📝 Release Notes

  • App names can now be up to 64 characters when creating an app in the console, matching rename and the API.
  • Creating an app with a blank name or a name over 64 characters now returns a clear error.

❓ Open Questions

N/A

🧪 Testing

  • New backend/tests/graphene/mutations/test_app.py: blank and whitespace names rejected, 65 chars rejected, 64 chars accepted. The rejection tests fail without the fix.
  • Backend: pytest tests/ passes except tests/utils/test_secret.py::test_file_read_permission_error, which also fails on main when run as root (chmod 000 does not block root). Unrelated.
  • Frontend: yarn test (459 passed), eslint, prettier and tsc --noEmit clean.

🎯 Reviewer Focus

backend/backend/graphene/mutations/app.py (CreateAppMutation.mutate).

➕ Additional Context

N/A

✨ How to Test the Changes Locally

  1. Open the create app dialog and enter a name longer than 32 characters. It now accepts up to 64.
  2. Send createApp with a blank name or a name over 64 chars. It returns a GraphQL error and no app is created.

💚 Did You...

  • Ensure linting passes (code style checks)?
  • Update dependencies and lockfiles (if required) — N/A
  • Update migrations (if required) — N/A
  • Regenerate graphql schema and types (if required) — N/A, schema unchanged
  • Verify the app builds locally? (tsc --noEmit)
  • Manually test the changes on different browsers/devices? — not done

🤖 Generated with Claude Code

https://claude.ai/code/session_01VZnEgPhtLy7nNZvyxispob


Generated by Claude Code

The create app dialog capped names at 32 chars, while the app settings
rename, the REST API, the DB column and the public API docs all allow
64. The GraphQL createApp mutation had no name check, so blank names
were accepted and names over 64 chars failed at the database.

- Console: use a 64-char MAX_APP_NAME_LENGTH for create and rename.
  MAX_INPUT_STRING_LENGTH (32) is unchanged for other inputs.
- createApp: reject blank names and names over 64 chars, matching
  updateAppInfo.
- Add tests for the createApp name checks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant