Skip to content

fix: remove invalid private(set) on computed property in ObservabilityService#139

Merged
jbcrane13 merged 2 commits intomainfrom
copilot/update-netmonitor-documentation
Apr 10, 2026
Merged

fix: remove invalid private(set) on computed property in ObservabilityService#139
jbcrane13 merged 2 commits intomainfrom
copilot/update-netmonitor-documentation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 10, 2026

Summary

Swift compilation error in ObservabilityService.swift was breaking the Coverage Gates CI pipeline. private(set) is only valid on stored var declarations — not on read-only computed properties.

Changes

  • Removed private(set) from isInitialized computed property — the modifier is illegal on a getter-only computed var; the property was already externally immutable by virtue of having no setter
  • Simplified the single-expression getter (dropped explicit get { } wrapper)
// Before — compiler error: 'private(set)' modifier cannot be used with 'let' declaration
private(set) var isInitialized: Bool {
    get { state.withLock { $0.isInitialized } }
}

// After
var isInitialized: Bool {
    state.withLock { $0.isInitialized }
}

Testing Done

  • Unit tests pass (xcodebuild test -scheme NetMonitor-macOS on mac-mini)
  • iOS tests pass (xcodebuild test -scheme NetMonitor-iOS on mac-mini)
  • SwiftLint clean — no new errors (swiftlint lint --quiet)
  • SwiftFormat clean — no reformats needed (swiftformat --lint .)
  • Manual verification on device / simulator

Notes for Reviewer

No behavioral change — a getter-only computed property has no setter regardless of access modifiers. The fix is purely syntactic.

Copilot AI changed the title [WIP] Update documentation for NetMonitor features fix: remove invalid private(set) on computed property in ObservabilityService Apr 10, 2026
Copilot AI requested a review from jbcrane13 April 10, 2026 03:41
@jbcrane13 jbcrane13 marked this pull request as ready for review April 10, 2026 05:56
Copilot AI review requested due to automatic review settings April 10, 2026 05:56
@jbcrane13 jbcrane13 merged commit 8e246c9 into main Apr 10, 2026
10 of 14 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a Swift compilation error in ObservabilityService by removing an invalid private(set) modifier from a getter-only computed property, unblocking the Coverage Gates CI pipeline.

Changes:

  • Removed private(set) from isInitialized (illegal on getter-only computed properties).
  • Simplified the computed property getter to a single-expression body.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jbcrane13 jbcrane13 deleted the copilot/update-netmonitor-documentation branch April 10, 2026 05:58
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.

3 participants