Comments (5)
Hi @jaanussiim, thank you very much for the simple reproducible example. That was very helpful.
I've been able to verify the crash, and I was able to reduce the example a little bit:
struct ParentView: View {
let store = Store(initialState: Parent.State()) {
Parent()
}
var body: some View {
Form {
IfLetStore(
store.scope(state: \.$child, action: \.child),
then: ChildView.init(store:),
else: {
Button(action: { store.send(.show) }) {
Text("Show")
}
}
)
}
}
}
@Reducer
struct Parent {
struct State {
@PresentationState var child: Child.State?
}
enum Action {
case child(PresentationAction<Child.Action>)
case show
}
var body: some ReducerOf<Self> {
Reduce { state, action in
switch action {
case .child(.presented(.dismiss)):
state.child = nil
return .none
case .child:
return .none
case .show:
state.child = Child.State()
return .none
}
}
.ifLet(\.$child, action: \.child) {
Child()
}
}
}
struct ChildView: View {
let store: StoreOf<Child>
var body: some View {
Button("Dismiss") { store.send(.dismiss) }
}
}
@Reducer
struct Child {
struct State {}
enum Action { case dismiss }
var body: some ReducerOf<Self> { EmptyReducer() }
}
I've got a fix for the crash, but want to get some tests into place and want to discuss with Stephen too. For now I suggest pinning to 1.5.1 to avoid the problem.
from swift-composable-architecture.
I have the same issue also.
from swift-composable-architecture.
@larryonoff @jaanussiim Can y'all try pointing to this branch and see if it fixes the problem for you?
https://github.com/pointfreeco/swift-composable-architecture/compare/store-cache-crash-fix
from swift-composable-architecture.
The location where I found the crash is no longer crashing when using branch store-cache-crash-fix
from swift-composable-architecture.
@mbrandonw thanks for the fix! The crash flew away.
from swift-composable-architecture.
Related Issues (20)
- reducer .ifLet seems to be causing `unable to type-check this expression in reasonable time` HOT 1
- Is visionOS a supported SDK for TCA? HOT 2
- NavigationLink in iOS17 usage HOT 1
- Sharing (observed) state through a computed property in combination with a didSet observer in the child causes an infinite loop HOT 1
- NavigationStack(path:root:destination) Not Working HOT 3
- Nesting a Cased reducer > Tabbed reducer > Navigation Stack > `navigationDestination(item:destination:)` breaks navigating to the same item twice. HOT 2
- Deprecation advice for navigationDestination(store:destination) on macOS HOT 1
- StackState and NavigationStack occasionally get out of sync under specific circumstances HOT 1
- Macro-provided `body` conflicts with `body` in extensions HOT 2
- New Destination/Path reducer crashes SwiftCompile in release configuration HOT 3
- Composable 1.8.1 - Destination with only AlertState generates empty body HOT 1
- Generated compiler macro regression HOT 5
- Binding for scrollPosition not working when using ForEach HOT 1
- @Reducer Macro doesn't correctly generate body when using EmptyReducer HOT 1
- Tabview does not update when scoping in a foreach loop HOT 2
- Store scoping issue with ForEach HOT 4
- View randomly doesn't update iOS 17 HOT 1
- Custom propertyWrapper in State: Compiler error when using new @ObservableState macro HOT 1
- TestStore received unexpected action, due to naming collision?
- Store scoping produces unexpected type, compiler error after updating to 1.9.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-composable-architecture.