Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abnormal behavior for timer in TCA Tutorials #3417

Open
2 of 3 tasks
minjunkim-dev opened this issue Sep 30, 2024 · 0 comments
Open
2 of 3 tasks

Abnormal behavior for timer in TCA Tutorials #3417

minjunkim-dev opened this issue Sep 30, 2024 · 0 comments
Labels
bug Something isn't working due to a bug in the library.

Comments

@minjunkim-dev
Copy link

Description

I am learning TCA through tutorials.

I found an abnormal behavior for timer in Section 3 of https://pointfreeco.github.io/swift-composable-architecture/main/tutorials/composablearchitecture/01-04-composingfeatures.

After activating each timer in two tabs (tab1, tab2), if you cancel the timer in one tab, the timers in both tabs are canceled.

The same id, "CancelID.timer" (enum case), is registered in the .cancellable(id:) method, so even if only one is canceled, both seem to be cancelled.

I think this behavior is different from what the tutorial intended.

Checklist

  • I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue or discussion.

Expected behavior

The timer on each tab operates “independently.”

Actual behavior

If you cancel the timer on one tab, the timer on the other tab will also be canceled.

Reproducing project

Please refer to Section 3(Deriving child stores) of https://pointfreeco.github.io/swift-composable-architecture/main/tutorials/composablearchitecture/01-04-composingfeatures.

The Composable Architecture version information

1.15.0

Destination operating system

iOS 18

Xcode version information

Xcode 16.0

Swift Compiler version information

swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: arm64-apple-macosx15.0
@minjunkim-dev minjunkim-dev added the bug Something isn't working due to a bug in the library. label Sep 30, 2024
minjunkim-dev pushed a commit to minjunkim-dev/swift-composable-architecture that referenced this issue Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working due to a bug in the library.
Projects
None yet
Development

No branches or pull requests

1 participant