Skip to content

properly handle app type in api#724

Merged
marccampbell merged 2 commits into
mainfrom
error-on-app-type
May 18, 2026
Merged

properly handle app type in api#724
marccampbell merged 2 commits into
mainfrom
error-on-app-type

Conversation

@marccampbell
Copy link
Copy Markdown
Member

problem: The exported aggregate client exposes GetApp, CreateApp, and DeleteApp as successful operations, but they either return a nil result with nil error or a nil error without calling either backend. The context platform client has real CreateApp/DeleteApp implementations, so callers using the higher-level client can believe an app was fetched, created, or deleted when no API request happened. DeleteApp is especially risky because it silently reports success for a no-op.

solution: Implement these methods by delegating to the appropriate platform/KOTS client based on app type or input options. If this abstraction cannot support an operation, return a non-nil unsupported-operation error rather than nil success.

NoaheCampbell
NoaheCampbell previously approved these changes May 17, 2026
Comment thread client/app.go Outdated
func (c *Client) CreateApp(appOptions interface{}) (interface{}, error) {
return nil, nil
switch opts := appOptions.(type) {
case string:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure what this case means. The DeleteApp function handles this differently. But also neither CreateApp nor DeleteApp are used anywhere outside of tests.

marccampbell and others added 2 commits May 18, 2026 14:15
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@marccampbell marccampbell merged commit 241f3a5 into main May 18, 2026
8 checks passed
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.

3 participants