Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/ComposableArchitecture/Core.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ final class RootCore<Root: Reducer>: Core {
if isCompleted.value {
reportIssue(
"""
An action was sent from a completed effect:
An action was sent from a completed effect.

Action:
\(debugCaseOutput(effectAction))
Expand Down
2 changes: 1 addition & 1 deletion Sources/ComposableArchitecture/Dependencies/Dismiss.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public struct DismissEffect: Sendable {
else {
reportIssue(
"""
A reducer requested dismissal at "\(fileID):\(line)", but couldn't be dismissed.
A reducer requested dismissal at "\(fileID):\(line)", but couldn't be dismissed.

This is generally considered an application logic error, and can happen when a reducer \
assumes it runs in a presentation context. If a reducer can run at both the root level \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ struct RecordMeetingTests {
// ❌ The store received 1 unexpected action by the end of this test: …
//
// Unhandled actions:
// .timerTick
// .timerTick
}
}
2 changes: 1 addition & 1 deletion Sources/ComposableArchitecture/Effect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
guard let handler else {
reportIssue(
"""
An "Effect.run" returned from "\(fileID):\(line)" threw an unhandled error.
An "Effect.run" returned from "\(fileID):\(line)" threw an unhandled error.

\(String(customDumping: error).indent(by: 4))

Expand Down Expand Up @@ -423,7 +423,7 @@
name: String?,
priority: TaskPriority? = nil,
operation: @escaping @Sendable () async throws -> Success
) where Failure == Error {

Check warning on line 426 in Sources/ComposableArchitecture/Effect.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (16) (test, IOS, 16.4)

use of protocol 'Error' as a type must be written 'any Error'; this will be an error in a future Swift language mode

Check warning on line 426 in Sources/ComposableArchitecture/Effect.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (16) (test, IOS, 16.4)

use of protocol 'Error' as a type must be written 'any Error'; this will be an error in a future Swift language mode
self.init(priority: priority, operation: operation)
}
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/ComposableArchitecture/Effects/TaskResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ extension TaskResult: Equatable where Success: Equatable {
let lhsTypeName = typeName(lhsType)
reportIssue(
"""
"\(lhsTypeName)" is not equatable.
"\(lhsTypeName)" is not equatable.
To test two values of this type, it must conform to the "Equatable" protocol. For \
example:
Expand Down Expand Up @@ -307,7 +307,7 @@ extension TaskResult: Hashable where Success: Hashable {
let errorType = typeName(type(of: error))
reportIssue(
"""
"\(errorType)" is not hashable.
"\(errorType)" is not hashable.
To hash a value of this type, it must conform to the "Hashable" protocol. For example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ extension BindingAction {
}
reportIssue(
"""
A binding action sent from a store was not handled.
A binding action sent from a store was not handled.

Action:
\(typeName(Action.self)).binding(.set(_, \(valueDump)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ public struct _NavigationLinkStoreContent<State, Label: View>: View {
"""
reportIssue(
"""
A navigation link at "\(fileID):\(line)" is unpresentable. …
A navigation link at "\(fileID):\(line)" is not presentable.

NavigationStack state element type:
\(elementType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,16 +500,16 @@ extension Store where State: ObservableState {

func uncachedStoreWarning<State, Action>(_ store: Store<State, Action>) -> String {
"""
Scoping from uncached \(store) is not compatible with observation.
Scoping from uncached '\(store)' is not compatible with observation.

This can happen for one of two reasons:

• A parent view scopes on a store using transform functions, which has been \
1. A parent view scopes on a store using transform functions, which has been \
deprecated, instead of with key paths and case paths. Read the migration guide for 1.5 \
to update these scopes: \
https://swiftpackageindex.com/pointfreeco/swift-composable-architecture/main/documentation/composablearchitecture/migratingto1.5

 A parent feature is using deprecated navigation APIs, such as 'IfLetStore', \
2. A parent feature is using deprecated navigation APIs, such as 'IfLetStore', \
'SwitchStore', 'ForEachStore', or any navigation view modifiers taking stores instead of \
bindings. Read the migration guide for 1.7 to update those APIs: \
https://swiftpackageindex.com/pointfreeco/swift-composable-architecture/main/documentation/composablearchitecture/migratingto1.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,22 +281,22 @@ public struct _ForEachReducer<
if state[keyPath: self.toElementsState][id: id] == nil {
reportIssue(
"""
A "forEach" at "\(self.fileID):\(self.line)" received an action for a missing element.
A "forEach" at "\(self.fileID):\(self.line)" received an action for a missing element.

Action:
\(debugCaseOutput(action))

This is generally considered an application logic error, and can happen for a few reasons:

A parent reducer removed an element with this ID before this reducer ran. This reducer \
A parent reducer removed an element with this ID before this reducer ran. This reducer \
must run before any other reducer removes an element, which ensures that element reducers \
can handle their actions while their state is still available.

An in-flight effect emitted this action when state contained no element at this ID. \
An in-flight effect emitted this action when state contained no element at this ID. \
While it may be perfectly reasonable to ignore this action, consider canceling the \
associated effect before an element is removed, especially if it is a long-living effect.

This action was sent to the store while its state contained no element at this ID. To \
This action was sent to the store while its state contained no element at this ID. To \
fix this make sure that actions for this reducer can only be sent from a store when \
its state contains an element at this id. In SwiftUI applications, use "ForEachStore".
""",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public struct _IfCaseLetReducer<Parent: Reducer, Child: Reducer>: Reducer {
reportIssue(
"""
An "ifCaseLet" at "\(self.fileID):\(self.line)" received a child action when child state \
was set to a different case.
was set to a different case.

Action:
\(String(customDumping: action).indent(by: 4))
Expand All @@ -224,16 +224,16 @@ public struct _IfCaseLetReducer<Parent: Reducer, Child: Reducer>: Reducer {

This is generally considered an application logic error, and can happen for a few reasons:

A parent reducer set "\(typeName(Parent.State.self))" to a different case before this \
A parent reducer set "\(typeName(Parent.State.self))" to a different case before this \
reducer ran. This reducer must run before any other reducer sets child state to a \
different case. This ensures that child reducers can handle their actions while their \
state is still available.

An in-flight effect emitted this action when child state was unavailable. While it may \
An in-flight effect emitted this action when child state was unavailable. While it may \
be perfectly reasonable to ignore this action, consider canceling the associated effect \
before child state changes to another case, especially if it is a long-living effect.

This action was sent to the store while state was another case. Make sure that actions \
This action was sent to the store while state was another case. Make sure that actions \
for this reducer can only be sent from a store when state is set to the appropriate \
case. In SwiftUI applications, use "SwitchStore".
""",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,22 +287,22 @@ public struct _IfLetReducer<Parent: Reducer, Child: Reducer>: Reducer {
reportIssue(
"""
An "ifLet" at "\(self.fileID):\(self.line)" received a child action when child state was \
"nil".
"nil".

Action:
\(String(customDumping: action).indent(by: 4))

This is generally considered an application logic error, and can happen for a few reasons:

A parent reducer set child state to "nil" before this reducer ran. This reducer must run \
A parent reducer set child state to "nil" before this reducer ran. This reducer must run \
before any other reducer sets child state to "nil". This ensures that child reducers can \
handle their actions while their state is still available.

An in-flight effect emitted this action when child state was "nil". While it may be \
An in-flight effect emitted this action when child state was "nil". While it may be \
perfectly reasonable to ignore this action, consider canceling the associated effect \
before child state becomes "nil", especially if it is a long-living effect.

This action was sent to the store while state was "nil". Make sure that actions for this \
This action was sent to the store while state was "nil". Make sure that actions for this \
reducer can only be sent from a store when state is non-"nil". In SwiftUI \
applications, use "IfLetStore".
""",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,19 +632,19 @@ public struct _PresentationReducer<Base: Reducer, Destination: Reducer>: Reducer
reportIssue(
"""
An "ifLet" at "\(self.fileID):\(self.line)" received a presentation action when \
destination state was absent.
destination state was absent.

Action:
\(debugCaseOutput(action))

This is generally considered an application logic error, and can happen for a few \
reasons:

A parent reducer set destination state to "nil" before this reducer ran. This reducer \
A parent reducer set destination state to "nil" before this reducer ran. This reducer \
must run before any other reducer sets destination state to "nil". This ensures that \
destination reducers can handle their actions while their state is still present.

This action was sent to the store while destination state was "nil". Make sure that \
This action was sent to the store while destination state was "nil". Make sure that \
actions for this reducer can only be sent from a store when state is present, or \
from effects that start from this reducer.
""",
Expand Down
8 changes: 4 additions & 4 deletions Sources/ComposableArchitecture/Reducer/Reducers/Scope.swift
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public struct Scope<ParentState, ParentAction, Child: Reducer>: Reducer {
reportIssue(
"""
A "Scope" at "\(fileID):\(line)" received a child action when child state was set to a \
different case.
different case.

Action:
\(debugCaseOutput(action))
Expand All @@ -357,18 +357,18 @@ public struct Scope<ParentState, ParentAction, Child: Reducer>: Reducer {
This is generally considered an application logic error, and can happen for a few \
reasons:

A parent reducer set "\(typeName(ParentState.self))" to a different case before the \
A parent reducer set "\(typeName(ParentState.self))" to a different case before the \
scoped reducer ran. Child reducers must run before any parent reducer sets child state \
to a different case. This ensures that child reducers can handle their actions while \
their state is still available. Consider using "Reducer.ifCaseLet" to embed this \
child reducer in the parent reducer that change its state to ensure the child reducer \
runs first.

An in-flight effect emitted this action when child state was unavailable. While it may \
An in-flight effect emitted this action when child state was unavailable. While it may \
be perfectly reasonable to ignore this action, consider canceling the associated effect \
before child state changes to another case, especially if it is a long-living effect.

This action was sent to the store while state was another case. Make sure that actions \
This action was sent to the store while state was another case. Make sure that actions \
for this reducer can only be sent from a store when state is set to the appropriate \
case. In SwiftUI applications, use "SwitchStore".
""",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,22 +526,22 @@ public struct _StackReducer<Base: Reducer, Destination: Reducer>: Reducer {
} else {
reportIssue(
"""
A "forEach" at "\(self.fileID):\(self.line)" received an action for a missing element.
A "forEach" at "\(self.fileID):\(self.line)" received an action for a missing element.

Action:
\(debugCaseOutput(destinationAction))

This is generally considered an application logic error, and can happen for a few reasons:

A parent reducer removed an element with this ID before this reducer ran. This reducer \
A parent reducer removed an element with this ID before this reducer ran. This reducer \
must run before any other reducer removes an element, which ensures that element \
reducers can handle their actions while their state is still available.

An in-flight effect emitted this action when state contained no element at this ID. \
An in-flight effect emitted this action when state contained no element at this ID. \
While it may be perfectly reasonable to ignore this action, consider canceling the \
associated effect before an element is removed, especially if it is a long-living effect.

This action was sent to the store while its state contained no element at this ID. To \
This action was sent to the store while its state contained no element at this ID. To \
fix this make sure that actions for this reducer can only be sent from a store when \
its state contains an element at this id. In SwiftUI applications, use \
"NavigationStack.init(path:)" with a binding to a store.
Expand All @@ -566,7 +566,7 @@ public struct _StackReducer<Base: Reducer, Destination: Reducer>: Reducer {
reportIssue(
"""
A "forEach" at "\(self.fileID):\(self.line)" received a "popFrom" action for a missing \
element.
element.

ID:
\(id)
Expand All @@ -586,7 +586,7 @@ public struct _StackReducer<Base: Reducer, Destination: Reducer>: Reducer {
reportIssue(
"""
A "forEach" at "\(self.fileID):\(self.line)" received a "push" action for an element it \
already contains.
already contains.

ID:
\(id)
Expand All @@ -606,7 +606,7 @@ public struct _StackReducer<Base: Reducer, Destination: Reducer>: Reducer {
reportIssue(
"""
A "forEach" at "\(self.fileID):\(self.line)" received a "push" action with an \
unexpected generational ID.
unexpected generational ID.

Received ID:
\(id)
Expand Down
2 changes: 1 addition & 1 deletion Sources/ComposableArchitecture/SwiftUI/Binding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ extension WithViewStore where ViewState: Equatable, Content: View {
"""
A binding action sent from a store \
\(context == .bindingState ? "for binding state defined " : "")at \
"\(fileID):\(line)" was not handled.
"\(fileID):\(line)" was not handled.

Action:
\(typeName(bindableActionType)).binding(.set(_, \(valueDump)))
Expand Down
Loading
Loading