wavetermdev/waveterm · error

app name too long: max %d characters

Error message

app name too long: max %d characters

What it means

ValidateAppId enforces MaxAppNameLen (50 characters) on the app name segment of an appId. This error means the name after the '/' is longer than 50 bytes, which could break on-disk paths and manifest consistency.

Source

Thrown at pkg/waveappstore/waveappstore.go:69

	}
	appNS = parts[0]
	appName = parts[1]
	if appNS == "" || appName == "" {
		return "", "", fmt.Errorf("invalid appId: namespace and name cannot be empty")
	}
	return appNS, appName, nil
}

func ValidateAppId(appId string) error {
	appNS, appName, err := ParseAppId(appId)
	if err != nil {
		return err
	}
	if len(appNS) > MaxNamespaceLen {
		return fmt.Errorf("namespace too long: max %d characters", MaxNamespaceLen)
	}
	if len(appName) > MaxAppNameLen {
		return fmt.Errorf("app name too long: max %d characters", MaxAppNameLen)
	}
	if !namespaceRegex.MatchString(appNS) {
		return fmt.Errorf("invalid namespace: must match pattern @?[a-z0-9-]+")
	}
	if !appNameRegex.MatchString(appName) {
		return fmt.Errorf("invalid app name: must match pattern [a-zA-Z0-9_-]+")
	}
	return nil
}

func GetAppDir(appId string) (string, error) {
	if err := ValidateAppId(appId); err != nil {
		return "", err
	}
	appNS, appName, _ := ParseAppId(appId)
	homeDir := wavebase.GetHomeDir()
	return filepath.Join(homeDir, "waveapps", appNS, appName), nil
}

View on GitHub (pinned to a4447c1563)

Solutions

  1. Shorten the app name to 50 characters or fewer.
  2. Truncate or slugify generated names before composing the appId.
  3. Re-publish the app under a shorter name and update references.
  4. Pre-validate with len(name) <= waveappstore.MaxAppNameLen in form/CLI inputs.

Example fix

// before
name := "my-super-descriptive-wave-application-project-final"
appId := waveappstore.MakeAppId("local", name) // name is 52 chars -> too long
// after
name := "my-super-descriptive-wave-application" // <= 50 chars
appId := waveappstore.MakeAppId("local", name)
Defensive patterns

Strategy: validation

Validate before calling

func nameLenOK(appId string) bool {
    _, name, err := waveappstore.ParseAppId(appId)
    return err == nil && len(name) <= waveappstore.MaxAppNameLen
}
if !nameLenOK(appId) { /* shorten the app name first */ }

Type guard

func appNameWithinLimit(appId string, max int) bool {
    _, name, err := waveappstore.ParseAppId(appId)
    return err == nil && len(name) <= max
}

Try / catch

if err := waveappstore.ValidateAppId(appId); err != nil {
    var maxLen int
    if _, scan := fmt.Sscanf(err.Error(), "app name too long: max %d", &maxLen); scan == nil {
        return fmt.Errorf("app name exceeds %d chars; shorten or slugify it", maxLen)
    }
    return err
}

Prevention

When it happens

Trigger: Calling ValidateAppId (or GetAppDir, PublishDraft, RevertDraft, MakeDraftFromLocal, DeleteApp, WriteAppFile) with an appId like "local/a-very-long-descriptive-application-name-exceeding-fifty-chars" where the name segment exceeds 50 characters.

Common situations: Auto-generating app names from long titles, URLs, or package names without truncation; concatenating suffixes ("-draft", "-copy") onto names already near the limit; importing apps named under looser external schemes.

Related errors


AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01). Data as JSON: /api/errors/80b07ff871f27567. Report an issue: GitHub.