You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I tried following the HigherOrderReducers-Recursion Use Case, but my app crashes and I don't know why. The difference between the Use Case and my example is, that my recursive state has a back-reference to the parent object, which required the recursive object to be a class instead of a struct.
When accessing attributes on the back-reference .parent in the reducer, the app crashes:
Simultaneous accesses to 0x101955c88, but modification requires exclusive access.
Previous access (a modification) started at libswiftCore.dylib`ReferenceWritableKeyPath._projectMutableAddress(from:) + 1413 (0x7ff81a208575).
Current access (a read) started at:
...
The position where the app crashed is marked below.
Expected behavior
Do not crash on accessing the parent reference.
Environment
swift-composable-architecture version 0.33.1
Xcode Version 13.3 beta 2 (13E5095k)
Swift 5.4
OS: MacOS 12.2.1 (21D62)
Additional context
I'm not knowledgeable enough to understand this crash, is this a limitation with TCA? How else would one model such a scenario, where access to the parent is necessary? Thanks in advance for any ideas.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
I tried following the HigherOrderReducers-Recursion Use Case, but my app crashes and I don't know why. The difference between the Use Case and my example is, that my recursive state has a back-reference to the parent object, which required the recursive object to be a class instead of a struct.
When accessing attributes on the back-reference .parent in the reducer, the app crashes:
The position where the app crashed is marked below.
Zip:
RecursiveActions.zip
Code:
Test case:
Expected behavior
Do not crash on accessing the parent reference.
Environment
Additional context
I'm not knowledgeable enough to understand this crash, is this a limitation with TCA? How else would one model such a scenario, where access to the parent is necessary? Thanks in advance for any ideas.
Beta Was this translation helpful? Give feedback.
All reactions