Repository navigation
SwiftUIQuery now pauses network-dependent queries while offline and resumes them when connectivity returns, preserving cached data and retry budgets.
Changes
- Add shared system network monitoring and explicitly controlled connectivity with
QueryClient(automaticallyMonitorsNetwork: false)andsetOnline(_:). - Add
.online,.always, and.offlineFirstnetwork modes, plusrefetchOnReconnect. - Expose
fetchStatusandisPausedthrough both Observation and Combine adapters. - Refresh active stale queries once per key on reconnect, without starting duplicate retry batches or refreshing inactive, disabled, or fresh queries.
- Preserve shared-request cancellation and resume state-based polling after recovery.
- Fix incorrect loading/fetching indicators when a manual refresh joins an already paused request.
Compatibility
Queries now default to .online. Select .always for local database/file operations or transports that manage their own connectivity. .always defaults to no automatic reconnect refetch. No new retry timer is enabled by default.
Requirements remain Swift 6.0+, iOS 15+, and macOS 14+.
Validation
- All 115 package tests passed, including both-adapter paused refresh regression, shared offline cancellation, and automatic-monitor lifetime tests.
- SwiftUI examples and iOS 15 API compatibility checks passed.
- Optimized Swift Package Release and iOS Simulator Release builds passed.
- GitHub Actions CI passed for the release commit.
Update your Swift Package dependency to 0.1.3. See Connectivity and recovery for details.