Skip to content

Fix: Parent Job is Cancelled #78

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

Merged
merged 1 commit into from
Feb 3, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.promise
import kotlin.coroutines.CoroutineContext
import kotlin.js.Promise
import kotlinx.coroutines.SupervisorJob

private val CoroutineContext4Js: CoroutineContext = Dispatchers.Default
private val CoroutineContext4Js: CoroutineContext = Dispatchers.Default + SupervisorJob()
Copy link
Owner

@ForteScarlet ForteScarlet Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any difference between using a custom scope and GlobalScope?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I tried to use GlobalScope, but it still threw the Parent job is Cancelled exception. This only works with SupervisorJob()

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. The merged version has been released and you can try to update it now!


private val CoroutineScope4Js: CoroutineScope = CoroutineScope(CoroutineContext4Js)

Expand Down