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
return .concatenate(longLivingEffects)
I want to have a possibility to cancel one of those pending (in the queue) effects.
Unfortunately, the standard return .cancel(id: particularEffectId) doesn't seem to work. (Which it probably should — it feels like it would be an 'expected behavior')
Canceled effects should be canceled regardless of whether they have already started executing or not.
Actual behavior
Effects only get canceled if they have already started executing.
Reproducing project
I have open-sourced simple project which is suitable for the issue illustration. It's not exactly "distilled", but it's basically clone of ReusableComponents-Downloadcase-study. https://github.com/RoBo-Inc/ReusableComponents-Download
The issue is illustrated by the very last commit (tagged 4.0.0). On that commit I added a feature: automatically start loading files one-by-one on the app launch. It works exactly as I want, and it's amazing that I achieved the desired behavior basically with the single line of code: return .concatenate(state.cityMapRows.ids.map { rowComponent(state, id: $0, action: .start) }) (in CityMaps.swift file)
But... there is a bug (or rather unexpected behavior). Let's say we start the app, the files begin downloading, and we decided that we don't want to download some particular file. So we click on it and cancel the downloading (via the popup dialog). At first all looks good, but when the downloading queue reaches the file, it starts to download anyways.
Of course there is a workaround for this example. But it requires much more then one line of code, and even additional tracking downloading state variable. So it would be much nicer if it just works out of the box from the beginning 🙂
The Composable Architecture version information
1.17.0
Destination operating system
iOS 18
Xcode version information
16.2
Swift Compiler version information
swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: arm64-apple-macosx15.0
The text was updated successfully, but these errors were encountered:
Hi @RoBo-Inc, this project is a little too complex for us to dive into and understand the issue you are seeing. Can you please minimize it, and ideally write a test that should pass in your opinion but does not?
Since it isn't clear this is an issue with the library, or perhaps even a duplicate of #1848, I am going to convert this to a discussion. Please feel free to continue the conversation over there!
Description
return .concatenate(longLivingEffects)
I want to have a possibility to cancel one of those pending (in the queue) effects.
Unfortunately, the standard
return .cancel(id: particularEffectId)
doesn't seem to work. (Which it probably should — it feels like it would be an 'expected behavior')It's probably related to this issue
Checklist
main
branch of this package.Expected behavior
Canceled effects should be canceled regardless of whether they have already started executing or not.
Actual behavior
Effects only get canceled if they have already started executing.
Reproducing project
I have open-sourced simple project which is suitable for the issue illustration. It's not exactly "distilled", but it's basically clone of
ReusableComponents-Downloadcase-study
.https://github.com/RoBo-Inc/ReusableComponents-Download
The issue is illustrated by the very last commit (tagged 4.0.0). On that commit I added a feature: automatically start loading files one-by-one on the app launch. It works exactly as I want, and it's amazing that I achieved the desired behavior basically with the single line of code:
return .concatenate(state.cityMapRows.ids.map { rowComponent(state, id: $0, action: .start) })
(in CityMaps.swift file)But... there is a bug (or rather unexpected behavior). Let's say we start the app, the files begin downloading, and we decided that we don't want to download some particular file. So we click on it and cancel the downloading (via the popup dialog). At first all looks good, but when the downloading queue reaches the file, it starts to download anyways.
Of course there is a workaround for this example. But it requires much more then one line of code, and even additional tracking downloading state variable. So it would be much nicer if it just works out of the box from the beginning 🙂
The Composable Architecture version information
1.17.0
Destination operating system
iOS 18
Xcode version information
16.2
Swift Compiler version information
The text was updated successfully, but these errors were encountered: