Skip to content

fix(service): normalize autoLaunchServiceList shape for reliable service autolaunch#207

Open
Asuka22687 wants to merge 1 commit intoreisxd:mainfrom
Asuka22687:fix/autolaunch-service-list
Open

fix(service): normalize autoLaunchServiceList shape for reliable service autolaunch#207
Asuka22687 wants to merge 1 commit intoreisxd:mainfrom
Asuka22687:fix/autolaunch-service-list

Conversation

@Asuka22687
Copy link

Summary

This PR fixes a data-shape mismatch in autoLaunchServiceList that can break service autolaunch behavior after settings updates.

Problem

autoLaunchServiceList is treated as an array at startup, but the autolaunchService action stored a string value directly.

  • Startup path expects: string[]
  • Settings write path was producing: string or ''

This mismatch can lead to inconsistent startup behavior and makes persisted config shape unstable across runs.

Root Cause

ModuleAction -> autolaunchService assigned config.autoLaunchServiceList = module where module is a scalar value from UI payload.

Changes

  • Added normalizeServiceAutoLaunchList(value) helper.
  • Normalized persisted value when reading startup autolaunch services.
  • Normalized autolaunchService writes to always store a list form:
    • selected module -> [moduleName]
    • disabled -> []

Backward Compatibility

Included migration-safe read behavior:

  • Existing configs with string values are accepted and normalized at runtime.

Validation

  • Static syntax check: node --check on modified service file.
  • Manual reasoning checks:
    • enable service autolaunch -> value becomes array
    • disable service autolaunch -> value becomes empty array
    • old string config remains launchable after normalization

Risk

Low. Scope is limited to autolaunch service config shape normalization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant