ModelEngine-Group / ModelEngine-Group/nexent

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

Open
#3,814 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5.9k
Forks
731
Avg merge
19h 34m
Merged PRs (30d)
172

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in backend/utils/config_utils.py:150-165 and compare update_single_config with set_single_config at lines 115-135. Grep for callers and inspect the database update helper to determine the intended contract. Done means the method's name, signature, and persisted behavior consistently describe either updating a value or only refreshing metadata.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.