Skip to content

Commit

Permalink
Merge branch 'main' into bump-sharing-requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis authored Jan 7, 2025
2 parents bd60bb6 + 42192d4 commit 2dcbef6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-sharing",
"state" : {
"branch" : "main",
"revision" : "c5ea46f0712cd3b639e2c7d6bf3f193116e0ff8d"
"revision" : "524e1a6868f0c9eebe8002e3f604912865521beb",
"version" : "1.0.4"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public struct _StoreCollection<ID: Hashable & Sendable, State, Action>: RandomAc
#endif
fileprivate init(_ store: Store<IdentifiedArray<ID, State>, IdentifiedAction<ID, Action>>) {
self.store = store
store._$observationRegistrar.access(store, keyPath: \.currentState)
self.data = store.withState { $0 }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public struct _PrintChangesReducer<Base: Reducer>: Reducer {
into state: inout Base.State, action: Base.Action
) -> Effect<Base.Action> {
if let printer = self.printer {
let changeTracker = SharedChangeTracker()
let changeTracker = SharedChangeTracker(reportUnassertedChanges: false)
return changeTracker.track {
let oldState = UncheckedSendable(state)
let effects = self.base.reduce(into: &state, action: action)
Expand Down
30 changes: 15 additions & 15 deletions Tests/ComposableArchitectureTests/StorePerceptionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ final class StorePerceptionTests: BaseTCATestCase {
Text(store.count.description)
}
}
#if DEBUG && !os(visionOS)
let previous = Perception.isPerceptionCheckingEnabled
Perception.isPerceptionCheckingEnabled = true
defer { Perception.isPerceptionCheckingEnabled = previous }
XCTExpectFailure {
render(FeatureView())
} issueMatcher: {
$0.compactDescription == """
failed - Perceptible state was accessed but is not being tracked. Track changes to state by \
wrapping your view in a 'WithPerceptionTracking' view. This must also be done for any \
escaping, trailing closures, such as 'GeometryReader', `LazyVStack` (and all lazy \
views), navigation APIs ('sheet', 'popover', 'fullScreenCover', etc.), and others.
"""
}
#endif
#if DEBUG && !os(visionOS)
let previous = Perception.isPerceptionCheckingEnabled
Perception.isPerceptionCheckingEnabled = true
defer { Perception.isPerceptionCheckingEnabled = previous }
XCTExpectFailure {
render(FeatureView())
} issueMatcher: {
$0.compactDescription == """
failed - Perceptible state was accessed but is not being tracked. Track changes to state by \
wrapping your view in a 'WithPerceptionTracking' view. This must also be done for any \
escaping, trailing closures, such as 'GeometryReader', `LazyVStack` (and all lazy \
views), navigation APIs ('sheet', 'popover', 'fullScreenCover', etc.), and others.
"""
}
#endif
}

@MainActor
Expand Down

0 comments on commit 2dcbef6

Please sign in to comment.