{"record":{"id":"464949ef0d32550f","repo":"wavetermdev/waveterm","slug":"must-provide-an-appid-to-listallappfilescommand","errorCode":null,"errorMessage":"must provide an appId to ListAllAppFilesCommand","messagePattern":"must provide an appId to ListAllAppFilesCommand","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wshrpc/wshserver/wshserver.go","lineNumber":976,"sourceCode":"\t\trtn = append(rtn, wshrpc.WorkspaceInfoData{\n\t\t\tWindowId:      workspaceEntry.WindowId,\n\t\t\tWorkspaceData: workspaceData,\n\t\t})\n\t}\n\treturn rtn, nil\n}\n\nfunc (ws *WshServer) ListAllAppsCommand(ctx context.Context) ([]wshrpc.AppInfo, error) {\n\treturn waveappstore.ListAllApps()\n}\n\nfunc (ws *WshServer) ListAllEditableAppsCommand(ctx context.Context) ([]wshrpc.AppInfo, error) {\n\treturn waveappstore.ListAllEditableApps()\n}\n\nfunc (ws *WshServer) ListAllAppFilesCommand(ctx context.Context, data wshrpc.CommandListAllAppFilesData) (*wshrpc.CommandListAllAppFilesRtnData, error) {\n\tif data.AppId == \"\" {\n\t\treturn nil, fmt.Errorf(\"must provide an appId to ListAllAppFilesCommand\")\n\t}\n\tresult, err := waveappstore.ListAllAppFiles(data.AppId)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tentries := make([]wshrpc.DirEntryOut, len(result.Entries))\n\tfor i, entry := range result.Entries {\n\t\tentries[i] = wshrpc.DirEntryOut{\n\t\t\tName:         entry.Name,\n\t\t\tDir:          entry.Dir,\n\t\t\tSymlink:      entry.Symlink,\n\t\t\tSize:         entry.Size,\n\t\t\tMode:         entry.Mode,\n\t\t\tModified:     entry.Modified,\n\t\t\tModifiedTime: entry.ModifiedTime,\n\t\t}\n\t}\n\treturn &wshrpc.CommandListAllAppFilesRtnData{","sourceCodeStart":958,"sourceCodeEnd":994,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wshrpc/wshserver/wshserver.go#L958-L994","documentation":"Returned when ListAllAppFilesCommand is invoked without an appId; the request is invalid because file listing is scoped per app.","triggerScenarios":"Calling ListAllAppFilesCommand with CommandListAllAppFilesData.AppId == \"\".","commonSituations":"Client forgot to resolve an app via ListAllEditableAppsCommand first; passing a zero-value struct; JSON payload omitting appid.","solutions":["Fetch available apps via ListAllEditableAppsCommand and pass a valid AppId","Ensure the AppId field is serialized in the RPC payload","Validate AppId non-empty in client code before the call"],"exampleFix":"// before\nfiles, err := client.ListAllAppFilesCommand(ctx, wshrpc.CommandListAllAppFilesData{})\n// after\nfiles, err := client.ListAllAppFilesCommand(ctx, wshrpc.CommandListAllAppFilesData{AppId: appId})","handlingStrategy":"validation","validationCode":"if data.AppId == \"\" {\n    return fmt.Errorf(\"cannot call ListAllAppFilesCommand: AppId is empty\")\n}","typeGuard":"func hasAppId(data wshrpc.CommandListAllAppFilesData) bool {\n    return data.AppId != \"\"\n}","tryCatchPattern":"files, err := client.ListAllAppFilesCommand(ctx, data)\nif err != nil {\n    if strings.Contains(err.Error(), \"must provide an appId\") {\n        // resolve appId via ListAllEditableAppsCommand\n    }\n    return err\n}","preventionTips":["Resolve AppId via ListAllEditableAppsCommand before file operations","Validate required fields before dispatching RPCs","Ensure JSON payloads include appid"],"tags":["validation","rpc","appstore","missing-parameter"],"backgroundTag":"missing-required-argument","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}