Skip to content

Conversation

mattt
Copy link
Collaborator

@mattt mattt commented Sep 24, 2025

Follow-up to #229

@pcuenca observed that tests were failing locally because shouldUseOfflineMode was occasionally evaluating isConnected to be false. This new behavior occurred after switching to Swift Testing, in #229. That PR didn't change anything about offline mode, but it did increase test parallelism, which I suspect surfaced a race condition in the network monitor.

This PR updates the network monitor to seed the offline / online state immediately from NWPathMonitor.currentPath after calling startMonitoring. This should fix intermittent offline-mode activation that's observed running tests locally.

@mattt

This comment was marked as resolved.

@mattt mattt force-pushed the mattt/fix-network-monitor-race branch from 091d6c8 to 78d3173 Compare September 25, 2025 12:23
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