Skip to content

Commit 42192d4

Browse files
authored
Don't report unasserted shared changes in Reducer._printChanges() (#3528)
* Don't report unasserted shared changes in `Reducer._printChanges()` * fix * wip * wip * wip
1 parent cc17134 commit 42192d4

File tree

6 files changed

+192
-24
lines changed

6 files changed

+192
-24
lines changed

.github/package.xcworkspace/xcshareddata/swiftpm/Package.resolved

+14-14
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"kind" : "remoteSourceControl",
1515
"location" : "https://github.com/pointfreeco/swift-case-paths",
1616
"state" : {
17-
"revision" : "642e6aab8e03e5f992d9c83e38c5be98cfad5078",
18-
"version" : "1.5.5"
17+
"revision" : "bc92c4b27f9a84bfb498cdbfdf35d5a357e9161f",
18+
"version" : "1.5.6"
1919
}
2020
},
2121
{
@@ -32,17 +32,17 @@
3232
"kind" : "remoteSourceControl",
3333
"location" : "https://github.com/apple/swift-collections",
3434
"state" : {
35-
"revision" : "9bf03ff58ce34478e66aaee630e491823326fd06",
36-
"version" : "1.1.3"
35+
"revision" : "671108c96644956dddcd89dd59c203dcdb36cec7",
36+
"version" : "1.1.4"
3737
}
3838
},
3939
{
4040
"identity" : "swift-concurrency-extras",
4141
"kind" : "remoteSourceControl",
4242
"location" : "https://github.com/pointfreeco/swift-concurrency-extras",
4343
"state" : {
44-
"revision" : "6054df64b55186f08b6d0fd87152081b8ad8d613",
45-
"version" : "1.2.0"
44+
"revision" : "163409ef7dae9d960b87f34b51587b6609a76c1f",
45+
"version" : "1.3.0"
4646
}
4747
},
4848
{
@@ -59,8 +59,8 @@
5959
"kind" : "remoteSourceControl",
6060
"location" : "https://github.com/pointfreeco/swift-dependencies",
6161
"state" : {
62-
"revision" : "7d2eb4ad20efb2838269645410d26b64ca48d8aa",
63-
"version" : "1.6.1"
62+
"revision" : "5526c8a27675dc7b18d6fa643abfb64bcb200b77",
63+
"version" : "1.6.2"
6464
}
6565
},
6666
{
@@ -122,26 +122,26 @@
122122
"kind" : "remoteSourceControl",
123123
"location" : "https://github.com/pointfreeco/swift-sharing",
124124
"state" : {
125-
"revision" : "f923992fc911368447074a56da13feadf87f07a0",
126-
"version" : "1.0.2"
125+
"revision" : "524e1a6868f0c9eebe8002e3f604912865521beb",
126+
"version" : "1.0.4"
127127
}
128128
},
129129
{
130130
"identity" : "swift-snapshot-testing",
131131
"kind" : "remoteSourceControl",
132132
"location" : "https://github.com/pointfreeco/swift-snapshot-testing",
133133
"state" : {
134-
"revision" : "7b0bbbae90c41f848f90ac7b4df6c4f50068256d",
135-
"version" : "1.17.5"
134+
"revision" : "42a086182681cf661f5c47c9b7dc3931de18c6d7",
135+
"version" : "1.17.6"
136136
}
137137
},
138138
{
139139
"identity" : "swift-syntax",
140140
"kind" : "remoteSourceControl",
141141
"location" : "https://github.com/swiftlang/swift-syntax",
142142
"state" : {
143-
"revision" : "515f79b522918f83483068d99c68daeb5116342d",
144-
"version" : "600.0.0-prerelease-2024-09-04"
143+
"revision" : "0687f71944021d616d34d922343dcef086855920",
144+
"version" : "600.0.1"
145145
}
146146
},
147147
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
{
2+
"originHash" : "be743d77a36d5e157b8f2f96e0924c48c1b3fc8eaaf625f6a20688077102dd90",
3+
"pins" : [
4+
{
5+
"identity" : "combine-schedulers",
6+
"kind" : "remoteSourceControl",
7+
"location" : "https://github.com/pointfreeco/combine-schedulers",
8+
"state" : {
9+
"revision" : "5928286acce13def418ec36d05a001a9641086f2",
10+
"version" : "1.0.3"
11+
}
12+
},
13+
{
14+
"identity" : "swift-case-paths",
15+
"kind" : "remoteSourceControl",
16+
"location" : "https://github.com/pointfreeco/swift-case-paths",
17+
"state" : {
18+
"revision" : "bc92c4b27f9a84bfb498cdbfdf35d5a357e9161f",
19+
"version" : "1.5.6"
20+
}
21+
},
22+
{
23+
"identity" : "swift-clocks",
24+
"kind" : "remoteSourceControl",
25+
"location" : "https://github.com/pointfreeco/swift-clocks",
26+
"state" : {
27+
"revision" : "cc46202b53476d64e824e0b6612da09d84ffde8e",
28+
"version" : "1.0.6"
29+
}
30+
},
31+
{
32+
"identity" : "swift-collections",
33+
"kind" : "remoteSourceControl",
34+
"location" : "https://github.com/apple/swift-collections",
35+
"state" : {
36+
"revision" : "671108c96644956dddcd89dd59c203dcdb36cec7",
37+
"version" : "1.1.4"
38+
}
39+
},
40+
{
41+
"identity" : "swift-concurrency-extras",
42+
"kind" : "remoteSourceControl",
43+
"location" : "https://github.com/pointfreeco/swift-concurrency-extras",
44+
"state" : {
45+
"revision" : "82a4ae7170d98d8538ec77238b7eb8e7199ef2e8",
46+
"version" : "1.3.1"
47+
}
48+
},
49+
{
50+
"identity" : "swift-custom-dump",
51+
"kind" : "remoteSourceControl",
52+
"location" : "https://github.com/pointfreeco/swift-custom-dump",
53+
"state" : {
54+
"revision" : "82645ec760917961cfa08c9c0c7104a57a0fa4b1",
55+
"version" : "1.3.3"
56+
}
57+
},
58+
{
59+
"identity" : "swift-dependencies",
60+
"kind" : "remoteSourceControl",
61+
"location" : "https://github.com/pointfreeco/swift-dependencies",
62+
"state" : {
63+
"revision" : "85f89f5d0ce5a18945f65371d40ca997da85a41a",
64+
"version" : "1.6.3"
65+
}
66+
},
67+
{
68+
"identity" : "swift-docc-plugin",
69+
"kind" : "remoteSourceControl",
70+
"location" : "https://github.com/swiftlang/swift-docc-plugin",
71+
"state" : {
72+
"revision" : "85e4bb4e1cd62cec64a4b8e769dcefdf0c5b9d64",
73+
"version" : "1.4.3"
74+
}
75+
},
76+
{
77+
"identity" : "swift-docc-symbolkit",
78+
"kind" : "remoteSourceControl",
79+
"location" : "https://github.com/swiftlang/swift-docc-symbolkit",
80+
"state" : {
81+
"revision" : "b45d1f2ed151d057b54504d653e0da5552844e34",
82+
"version" : "1.0.0"
83+
}
84+
},
85+
{
86+
"identity" : "swift-identified-collections",
87+
"kind" : "remoteSourceControl",
88+
"location" : "https://github.com/pointfreeco/swift-identified-collections",
89+
"state" : {
90+
"revision" : "2f5ab6e091dd032b63dacbda052405756010dc3b",
91+
"version" : "1.1.0"
92+
}
93+
},
94+
{
95+
"identity" : "swift-macro-testing",
96+
"kind" : "remoteSourceControl",
97+
"location" : "https://github.com/pointfreeco/swift-macro-testing",
98+
"state" : {
99+
"revision" : "20c1a8f3b624fb5d1503eadcaa84743050c350f4",
100+
"version" : "0.5.2"
101+
}
102+
},
103+
{
104+
"identity" : "swift-navigation",
105+
"kind" : "remoteSourceControl",
106+
"location" : "https://github.com/pointfreeco/swift-navigation",
107+
"state" : {
108+
"revision" : "e28911721538fa0c2439e92320bad13e3200866f",
109+
"version" : "2.2.3"
110+
}
111+
},
112+
{
113+
"identity" : "swift-perception",
114+
"kind" : "remoteSourceControl",
115+
"location" : "https://github.com/pointfreeco/swift-perception",
116+
"state" : {
117+
"revision" : "8d52279b9809ef27eabe7d5420f03734528f19da",
118+
"version" : "1.4.1"
119+
}
120+
},
121+
{
122+
"identity" : "swift-sharing",
123+
"kind" : "remoteSourceControl",
124+
"location" : "https://github.com/pointfreeco/swift-sharing",
125+
"state" : {
126+
"revision" : "dbcd9d49089c4b0d171bc28244f21f4cf9813b11",
127+
"version" : "1.1.2"
128+
}
129+
},
130+
{
131+
"identity" : "swift-snapshot-testing",
132+
"kind" : "remoteSourceControl",
133+
"location" : "https://github.com/pointfreeco/swift-snapshot-testing",
134+
"state" : {
135+
"revision" : "42a086182681cf661f5c47c9b7dc3931de18c6d7",
136+
"version" : "1.17.6"
137+
}
138+
},
139+
{
140+
"identity" : "swift-syntax",
141+
"kind" : "remoteSourceControl",
142+
"location" : "https://github.com/swiftlang/swift-syntax",
143+
"state" : {
144+
"revision" : "0687f71944021d616d34d922343dcef086855920",
145+
"version" : "600.0.1"
146+
}
147+
},
148+
{
149+
"identity" : "swift-tagged",
150+
"kind" : "remoteSourceControl",
151+
"location" : "https://github.com/pointfreeco/swift-tagged.git",
152+
"state" : {
153+
"revision" : "3907a9438f5b57d317001dc99f3f11b46882272b",
154+
"version" : "0.10.0"
155+
}
156+
},
157+
{
158+
"identity" : "xctest-dynamic-overlay",
159+
"kind" : "remoteSourceControl",
160+
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
161+
"state" : {
162+
"revision" : "a3f634d1a409c7979cabc0a71b3f26ffa9fc8af1",
163+
"version" : "1.4.3"
164+
}
165+
}
166+
],
167+
"version" : 3
168+
}

Examples/SyncUps/SyncUps/AppFeature.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct AppView: View {
7676
.productMock,
7777
.engineeringMock,
7878
]
79-
return AppView(
79+
AppView(
8080
store: Store(initialState: AppFeature.State()) {
8181
AppFeature()
8282
}

Examples/SyncUps/SyncUps/SyncUpsList.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct SyncUpsList {
5454
?? Attendee(id: Attendee.ID(uuid()))
5555
)
5656
}
57-
state.$syncUps.withLock { $0.append(syncUp) }
57+
state.$syncUps.withLock { _ = $0.append(syncUp) }
5858
state.destination = nil
5959
return .none
6060

@@ -80,7 +80,7 @@ struct SyncUpsListView: View {
8080

8181
var body: some View {
8282
List {
83-
ForEach(store.$syncUps) { $syncUp in
83+
ForEach(Array(store.$syncUps)) { $syncUp in
8484
NavigationLink(state: AppFeature.Path.State.detail(SyncUpDetail.State(syncUp: $syncUp))) {
8585
CardView(syncUp: syncUp)
8686
}
@@ -161,7 +161,7 @@ extension LabelStyle where Self == TrailingIconLabelStyle {
161161
.productMock,
162162
.engineeringMock,
163163
]
164-
return NavigationStack {
164+
NavigationStack {
165165
SyncUpsListView(
166166
store: Store(initialState: SyncUpsList.State()) {
167167
SyncUpsList()

Package.resolved

+5-5
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
"kind" : "remoteSourceControl",
6161
"location" : "https://github.com/pointfreeco/swift-dependencies",
6262
"state" : {
63-
"revision" : "7d2eb4ad20efb2838269645410d26b64ca48d8aa",
64-
"version" : "1.6.1"
63+
"revision" : "5526c8a27675dc7b18d6fa643abfb64bcb200b77",
64+
"version" : "1.6.2"
6565
}
6666
},
6767
{
@@ -123,14 +123,14 @@
123123
"kind" : "remoteSourceControl",
124124
"location" : "https://github.com/pointfreeco/swift-sharing",
125125
"state" : {
126-
"revision" : "5d3d1193225567d156dae16b2bb353ef261011f9",
127-
"version" : "1.0.2"
126+
"revision" : "524e1a6868f0c9eebe8002e3f604912865521beb",
127+
"version" : "1.0.4"
128128
}
129129
},
130130
{
131131
"identity" : "swift-snapshot-testing",
132132
"kind" : "remoteSourceControl",
133-
"location" : "https://github.com/pointfreeco/swift-snapshot-testing.git",
133+
"location" : "https://github.com/pointfreeco/swift-snapshot-testing",
134134
"state" : {
135135
"revision" : "42a086182681cf661f5c47c9b7dc3931de18c6d7",
136136
"version" : "1.17.6"

Sources/ComposableArchitecture/Reducer/Reducers/DebugReducer.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public struct _PrintChangesReducer<Base: Reducer>: Reducer {
8686
into state: inout Base.State, action: Base.Action
8787
) -> Effect<Base.Action> {
8888
if let printer = self.printer {
89-
let changeTracker = SharedChangeTracker()
89+
let changeTracker = SharedChangeTracker(reportUnassertedChanges: false)
9090
return changeTracker.track {
9191
let oldState = UncheckedSendable(state)
9292
let effects = self.base.reduce(into: &state, action: action)

0 commit comments

Comments
 (0)