BrainDrive-Core
BrainDrive-Core copied to clipboard
Core Hardening — SettingsService Scope Casing Compatibility (`user` vs `USER`)
🛡️ Core Hardening — SettingsService Scope Casing Compatibility (user vs USER)
Objective
- Ensure
SettingsServicereads existing settings instances regardless of scope casing differences (e.g.,uservsUSER). - Prevent duplicate instances from being created due to casing mismatches.
- Normalize all writes to a canonical lowercase scope (
user) while remaining backward-compatible with pre-existing uppercase rows.
Background
- Some environments/databases contain settings with uppercase scopes (e.g.,
USER). - The current
SettingsServicequeries/writes using lowercase (user). If an uppercase row exists, the service may fail to find it and create a duplicate lowercase row. - Standardizing scope handling avoids duplicate instances and reduces the need for ad-hoc plugin workarounds.