Skip to content

bug: template settings and inconsistent API behavior ("empty field" vs "delete request") #5066

Closed as not planned

Description

@mtojek

Spotted in: #5060 (comment)

When a user wants to clear the field content (e.g. description) using the Template Settings form, and submit description: "", it isn't possible as the API considers it as "no change". On the other hand, a user can set the icon field, but calling the CLI: coder templates edit <template-name> will simply remove the icon.

The suggested solution would be to distinguish these actions:

  • delete the field: field "" is present in the JSON request
  • leave as is: field is not present in the request
  • modify the field: non-empty field is present in the request

It implicates that CreateTemplateRequest and UpdateTemplateMeta should either contain nillable fields or we need to redesign that contract (API can receive a set of modify-actions).

Let me know your thoughts!

Activity

  1. github-actions commented on Jan 17, 2023

    @github-actions
    Contributor

    This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleThis issue is like stale bread.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions