Semantic ambiguity in configuration default handling #279

Closed
opened 2026-04-05 16:17:16 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @xuan25 on 10/13/2025

Some non-functional configuration keywords are floating around. They either (1) do nothing, or (2) act as placeholders at first but are later treated as default values. This significantly reduces the readability of the codebase.

For example, in the auto-update logic:

const state = reactive({
    ...
    autoUpdateVRCX: 'Auto Download',
    ...
});

...

const autoUpdateVRCX = configRepository.getString('VRCX_autoUpdateVRCX', 'Auto Download');

...

if (autoUpdateVRCX === 'Auto Install') {
    state.autoUpdateVRCX = 'Auto Download';
} else {
    state.autoUpdateVRCX = autoUpdateVRCX;
}

...

// From now on, state.autoUpdateVRCX is used throughout the codebase.

Here, we can have two interpretations/assumptions of the default behaviour of autoUpdateVRCX:

  1. If the initial value of state.autoUpdateVRCX is the default, the logic is wrong, because it’s always overridden by configRepository.getString.

  2. If the default is the fallback value returned by configRepository.getString, then the initial value of state.autoUpdateVRCX semantically means “undefined” or “null.” However, the current implementation uses the literal string "Auto Download" to represent that undefined/null state, which is not intuitive.

Unfortunately, this isn’t easy to fix with a small change, as it may conflict with an latent standard which I am not full aware of across the codebase. See #1414 for more details.

*Originally created by @xuan25 on 10/13/2025* Some non-functional configuration keywords are floating around. They either (1) do nothing, or (2) act as placeholders at first but are later treated as default values. This significantly reduces the readability of the codebase. For example, in the auto-update logic: ```c# const state = reactive({ ... autoUpdateVRCX: 'Auto Download', ... }); ... const autoUpdateVRCX = configRepository.getString('VRCX_autoUpdateVRCX', 'Auto Download'); ... if (autoUpdateVRCX === 'Auto Install') { state.autoUpdateVRCX = 'Auto Download'; } else { state.autoUpdateVRCX = autoUpdateVRCX; } ... // From now on, state.autoUpdateVRCX is used throughout the codebase. ``` Here, we can have **two** interpretations/assumptions of the default behaviour of `autoUpdateVRCX`: 1. If the **initial value** of `state.autoUpdateVRCX` is the default, the **logic is wrong**, because it’s always overridden by `configRepository.getString`. 2. If the default is the **fallback value returned** by `configRepository.getString`, then the initial value of `state.autoUpdateVRCX` semantically means “undefined” or “null.” However, the current implementation uses the literal string "Auto Download" to represent that undefined/null state, which is **not intuitive**. Unfortunately, this isn’t easy to fix with a small change, as it may conflict with an latent standard which I am not full aware of across the codebase. See #1414 for more details.
MrUnknownDE added the NicheNicheNicheNicheNicheNicheNicheNicheNicheNiche labels 2026-04-05 16:17:16 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/VRCX#279