Skip to content

Fix location service startup type - #4972

Merged
ChrisTitusTech merged 2 commits into
ChrisTitusTech:mainfrom
aim9sour:fix/location-service-startup-type
Aug 19, 2026
Merged

Fix location service startup type#4972
ChrisTitusTech merged 2 commits into
ChrisTitusTech:mainfrom
aim9sour:fix/location-service-startup-type

Conversation

@aim9sour

Copy link
Copy Markdown
Contributor

Type of Change

  • New feature
  • Bug fix
  • Documentation update
  • Refactor
  • UI/UX improvement

Description

Use the canonical Disabled startup type for the lfsvc location service.

PowerShell accepts the unique Disable enum prefix, but WinUtil also compares configured startup types with ServiceController.StartType as strings. Since the service reports Disabled, the previous value prevented WinUtil from recognizing the matching state and could trigger a redundant Set-Service call.

This also validates configured StartupType and OriginalType values against the canonical service startup types so similar typos are caught by Pester.

Microsoft documents Disabled as the accepted startup type: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/set-service#-startuptype

Testing

  • ./Compile.ps1
  • Invoke-Pester -Path 'pester/configs.Tests.ps1' -Output Detailed -CI (21 passed)
  • Verified the new config validation fails on Disable before the fix and passes on Disabled

Issue related to PR

  • None

@github-actions github-actions Bot added the bug Something isn't working label Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fede4199-d85c-41dc-a100-67d4de48ac8f

📥 Commits

Reviewing files that changed from the base of the PR and between 279fb4b and 9dc0289.

📒 Files selected for processing (1)
  • pester/configs.Tests.ps1
🚧 Files skipped from review as they are similar to previous changes (1)
  • pester/configs.Tests.ps1

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Corrected the service startup setting to use the valid “Disabled” value.
  • Tests

    • Enhanced configuration validation to check supported service startup types, including original values when provided.

Walkthrough

The PR changes the lfsvc startup type from Disable to Disabled. It adds tests for the expected value and validates service startup metadata against an allowlist.

Changes

Service startup metadata

Layer / File(s) Summary
Correct and validate service startup types
config/tweaks.json, pester/configs.Tests.ps1
The lfsvc service uses Disabled. Configuration tests verify the lfsvc entry and validate non-empty StartupType and OriginalType values against the supported allowlist.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: christitustech

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change to the location service startup type.
Description check ✅ Passed The description directly explains the startup type fix, validation changes, rationale, and testing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pester/configs.Tests.ps1`:
- Line 431: Add a focused regression assertion in the tests covering
WPFTweaksLocation.service[0].StartupType that explicitly verifies the lfsvc
service value is exactly Disabled, rather than relying only on the
allowed-service-startup-types allowlist. Apply the same exact-value assertion to
the related test at the other referenced location.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0312d278-8aec-49cb-bef1-643ccb52b127

📥 Commits

Reviewing files that changed from the base of the PR and between aee3e7a and 279fb4b.

📒 Files selected for processing (2)
  • config/tweaks.json
  • pester/configs.Tests.ps1

Comment thread pester/configs.Tests.ps1
@ChrisTitusTech
ChrisTitusTech merged commit 87a0eb8 into ChrisTitusTech:main Aug 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants