Skip to content

_clean_json_payload drops nested None, so update() cannot remove a build tag or clear a field #1136

Closed

Description

@vdusek

Every update and create body goes through _clean_json_payload (_resource_client.py#L154-L187, called at #L253, #L290, #L307). It removes None at every nesting level and then removes dicts that end up empty.

The ActorClient.update() docstring says a tag is removed by setting it to None, e.g. {'latest': {'buildId': 'abc'}, 'beta': None} (actor.py#L180-L182). The API docs agree: taggedBuilds maps a tag to a build object or null. In the client, 'beta': None is stripped before sending. actor.update(tagged_builds={'beta': None}) sends {}, the API changes nothing, and the call returns without error.

The same filter means no update can send null to clear a field, such as a run's generalAccess (run.py#L78-L105). Empty lists are also turned into None before the filter, so schedule.update(actions=[]) and version.update(env_vars=[], source_files=[]) are silently ignored (schedule.py#L95, actor_version.py#L107-L110).

The JS client sends the update object as given, so null reaches the API (resource_client.ts#L76-L91; generalAccess?: RUN_GENERAL_ACCESS | null at run.ts#L682-L692).

Expected behavior

tagged_builds={'beta': None} sends {"taggedBuilds": {"beta": null}} and removes the tag. Drop None only at the top level of the payload (an unset argument), and keep None inside values the caller passed. An empty list the caller passed is sent as []. Clearing top-level fields to null needs a separate sentinel and is tracked in #1135.

✍️ Drafted by Claude Code

Activity

  1. added
    bug
    t-tooling
    on Oct 16, 2026
  2. self-assigned this
    on Oct 16, 2026
  3. added theissue type on Oct 30, 2026
  4. removed
    bug
    on Oct 30, 2026
  5. removed their assignment
    on Nov 9, 2026
  6. added this to the 4.0 milestone on Nov 9, 2026
  7. self-assigned this
    on Nov 11, 2026
  8. added a commit that references this issue on Nov 11, 2026
    6f7375b
  9. removed this from the 4.0 milestone on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

t-tooling

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions