Skip to content

Config: delete dead/unused config keys #440

@lonix

Description

@lonix

Problem

Config-key audit found nine keys that are declared in src/services/config-schema.ts but never read by runtime code. Each surfaces in the Settings UI as a configurable option that does nothing, costing operator attention and (post-#436 / #439) demanding label and type metadata for keys that shouldn't exist.

Dead keys

  • help.enabled/help is always registered, no read site.
  • quotes.add_roles — never read; quote-add permission gating isn't implemented.
  • voicetracking.admin_roles — never read; only appears in migration / wizard scaffolding.
  • core.startup.enabled, core.startup.channel_id
  • core.errors.enabled, core.errors.channel_id
  • core.config.enabled, core.config.channel_id
  • core.cron.enabled, core.cron.channel_id
  • core.cleanup.enabled — never read; only core.cleanup.channel_id is consumed (src/services/voice-channel-truncation.ts:94).

The future of the entire core.* namespace is up for separate discussion (see the rationalization issue in this batch); this issue removes only the keys with zero reads. core.cleanup.channel_id stays for now.

Proposed change

  • Remove the listed entries from ConfigSchema, defaultConfig, and settingsMetadata.
  • Add a startup migration step that drops these rows from the configs collection so existing deployments don't carry orphan data.
  • Before deletion, grep for dynamic string-built keys (e.g., `${feature}.enabled`) to confirm nothing reads them via metaprogramming.
  • If quotes.add_roles represents a desired feature that just isn't wired (role-gated /quote add), file a separate issue to implement it before deletion. Default plan: delete.

Acceptance

  • grep -rn '<key>' src returns nothing for each removed key after the change.
  • A fresh bot start on a previously-configured deployment removes the orphan rows.
  • Settings page no longer renders entries for these keys.
  • Existing tests still pass.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions