Skip to content

TenantConfigManager.update_single_config has no value argument — it can only bump timestamps #3814

Description

@taoh88

backend/utils/config_utils.py:150-165:

def update_single_config(self, tenant_id: str | None = None, key: str | None = None):
    """Update configuration value in database"""
    if tenant_id is None:
        logger.warning(...)
        return

    existing_config = get_single_config_info(tenant_id, key)
    if existing_config:
        update_data = {
            "updated_by": tenant_id,
            "update_time": func.current_timestamp()
        }
        update_config_by_tenant_config_id_and_data(
            existing_config["tenant_config_id"], update_data)
        return

The signature accepts tenant_id and key but no value. The function looks up the existing row and writes back only updated_by + update_time. The actual config_value column is untouched. Calling this method to "update" a config in fact does nothing observable from the API surface — just touches the audit metadata.

Compare with set_single_config directly above (lines 115-135) which does the same key plus a real config_value. That's the body the update method appears to want.

Either:

  1. The intended signature should include value, and the body should pass "config_value": value into update_data — in which case this is dead/broken code with a misleading name; or
  2. The method is genuinely meant to be a "touch" / re-stamp helper and should be renamed touch_single_config to make the contract honest.

A grep of the codebase reveals no caller using update_single_config, suggesting nobody noticed because nobody invokes it — which is its own smell.

Severity: Low (no user-visible breakage today), but high confusion risk for the next contributor.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions