File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Sources/ComposableArchitecture/Reducer/Reducers Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,29 @@ public struct _StackReducer<
264
264
. map { toStackAction. embed ( . element( id: elementID, action: $0) ) }
265
265
. _cancellable ( navigationIDPath: elementNavigationIDPath)
266
266
} else {
267
- runtimeWarn ( " TODO " )
267
+ runtimeWarn (
268
+ """
269
+ A " forEach " at " \( self . fileID) : \( self . line) " received an action for a missing element.
270
+
271
+ Action:
272
+ \( debugCaseOutput ( destinationAction) )
273
+
274
+ This is generally considered an application logic error, and can happen for a few reasons:
275
+
276
+ • A parent reducer removed an element with this ID before this reducer ran. This reducer \
277
+ must run before any other reducer removes an element, which ensures that element
278
+ reducers can handle their actions while their state is still available.
279
+
280
+ • An in-flight effect emitted this action when state contained no element at this ID. \
281
+ While it may be perfectly reasonable to ignore this action, consider canceling the \
282
+ associated effect before an element is removed, especially if it is a long-living effect.
283
+
284
+ • This action was sent to the store while its state contained no element at this ID. To \
285
+ fix this make sure that actions for this reducer can only be sent from a view store when \
286
+ its state contains an element at this id. In SwiftUI applications, use \
287
+ " NavigationStackStore " .
288
+ """
289
+ )
268
290
destinationEffects = . none
269
291
}
270
292
You can’t perform that action at this time.
0 commit comments