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
- If the behavior is documented, but you disagree with it, please do file an issue, but as a "Design consideration," not a "Bug report."
15
+
- If you don't understand why something behaves the way it does, consider asking on [StackOverflow](https://stackoverflow.com/) or the [Kotlin Slack](https://surveys.jetbrains.com/s3/kotlin-slack-sign-up). The community is active and will likely clarify everything better than we could!
16
+
* Is the problem not in some third-party library, not in [Kotlin](kotl.in/issue), or your own code—is it in the `kotlinx.coroutines` library itself?
17
+
- Example: you write for Android, and your code works properly on most devices, but for a couple of them, it fails. Then please direct this to Google and/or the manufacturer of your device.
18
+
* Maybe you're using some ancient version, and the problem doesn't happen with the latest releases of the compiler and the library?
19
+
-->
20
+
21
+
**Describe the bug**
22
+
23
+
What happened? What should have happened instead?
24
+
25
+
**Provide a Reproducer**
26
+
27
+
* If possible, please provide a small self-contained project (or even just a single file) where the issue reproduces.
28
+
* If you can't pinpoint the issue, please provide at least *some* project where this reproduces, for example, your production one. If you are not ready to show the project publicly, we are open to discussing the details privately.
29
+
* If you really can't provide any code, please do still open an issue. This may prompt other people to chime in with their reproducers.
This is a place for issue reports that are not exactly bugs (wrong unintentional behavior) but for our library behaving suboptimally (though this could have been intentional).
12
+
13
+
**Double-check**
14
+
15
+
* If the behavior is strange, surprising, and undocumented, it could be a good idea to file a "Bug report" instead.
16
+
* Is this still relevant with the latest version of the library? We could have changed this already.
17
+
* Maybe there are good reasons for the existing behavior. Please try searching for existing discussions of the problem.
18
+
* Are you using the right abstraction? Consider asking on [StackOverflow](https://stackoverflow.com/) or the [Kotlin Slack](https://surveys.jetbrains.com/s3/kotlin-slack-sign-up). Maybe your need is better solved by some other abstraction entirely.
19
+
20
+
-->
21
+
22
+
**What do we have now?**
23
+
24
+
Preferably with specific code examples.
25
+
26
+
**What should be instead?**
27
+
28
+
Preferably with specific code examples.
29
+
30
+
**Why?**
31
+
32
+
The upsides of your proposal.
33
+
* Who would benefit from this and how?
34
+
- Would it be possible to cover new use cases?
35
+
- Would some code become clearer?
36
+
- Would the library become conceptually simpler?
37
+
- etc.
38
+
39
+
**Why not?**
40
+
41
+
The downsides of your proposal that you already see.
42
+
* Is this a breaking change?
43
+
* Are there use cases that are better solved by what we have now?
44
+
* Does some code become less clear after this change?
- Did you check the latest version of the library?
15
+
- Maybe it's in a form you didn't expect? Consider asking on [StackOverflow](https://stackoverflow.com/) or the [Kotlin Slack](https://surveys.jetbrains.com/s3/kotlin-slack-sign-up). The community will likely come up with some code that solves your need, and faster than it would take us to answer the issue!
16
+
* Do you actually *need* this feature? Maybe restructuring your code would neatly eliminate the problem the feature would be solving.
17
+
* Is the coroutines library the best place for this feature? Maybe it would be better suited for some third-party library?
18
+
-->
19
+
20
+
**Use case**
21
+
22
+
Explain what *specifically* you are trying to do and why.
23
+
- Example: "I have a `SharedFlow<Double>` that represents readings from an external device. The readings arrive in a set interval of 100 milliseconds. However, I also need to be able to calibrate the state of the external device by setting the readings from inside the program. When I set the state, the `SharedFlow<Double>` must immediately emit the value that was set and ignore any values coming from the device in the following 10 milliseconds since they are considered outdated, as the device is only guaranteed to recalibrate to the updated value after that period."
24
+
- Non-example: "I have a `SharedFlow<T>` that has several sources of its values, and these sources need to have priorities attached to them so that one source always takes precedence over the other in a close race."
25
+
- Non-example: "RxJava has feature X, so the coroutines library should also."
26
+
27
+
**The Shape of the API**
28
+
29
+
What could the desired API look like? What would some sample code using the new feature look like? If you don't have a clear idea, pseudocode or just explaining the API shape is also perfectly fine.
30
+
31
+
**Prior Art**
32
+
33
+
(Optional) Maybe you have seen something like the feature you need, but in other libraries, or there is something very similar but not quite sufficient in `kotlinx.coroutines`? Maybe there's already a way to do it, but it's too cumbersome and unclear?
Copy file name to clipboardExpand all lines: CHANGES.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -223,7 +223,7 @@ Note that this is a full changelog relative to 1.4.3 version. Changelog relative
223
223
*`Flow.runningFold` operator (#2641).
224
224
*`CoroutinesTimeout` rule for JUnit5 (#2197).
225
225
* Internals of `Job` and `AbstractCoroutine` was reworked, resulting in smaller code size, less memory footprint, and better performance (#2513, #2512).
226
-
*`CancellationException` from Kotlin standard library is used for cancellation on Koltin/JS and Kotlin/Native (#2638).
226
+
*`CancellationException` from Kotlin standard library is used for cancellation on Kotlin/JS and Kotlin/Native (#2638).
227
227
* Introduced new `DelicateCoroutinesApi` annotation that warns users about potential target API pitfalls and suggests studying API's documentation first. The only delicate API right now is `GlobalScope` (#2637).
228
228
* Fixed bug introduced in `1.4.3` when `kotlinx-coroutines-core.jar` triggered IDEA debugger failure (#2619).
229
229
* Fixed memory leak of `ChildHandlerNode` with reusable continuations (#2564).
@@ -264,7 +264,7 @@ Note that this is a full changelog relative to 1.4.3 version. Changelog relative
264
264
*`Flow.runningFold` operator (#2641).
265
265
*`CoroutinesTimeout` rule for JUnit5 (#2197).
266
266
* Internals of `Job` and `AbstractCoroutine` was reworked, resulting in smaller code size, less memory footprint, and better performance (#2513, #2512).
267
-
*`CancellationException` from Kotlin standard library is used for cancellation on Koltin/JS and Kotlin/Native (#2638).
267
+
*`CancellationException` from Kotlin standard library is used for cancellation on Kotlin/JS and Kotlin/Native (#2638).
268
268
* Introduced new `DelicateCoroutineApi` annotation that warns users about potential target API pitfalls and suggests studying API's documentation first. The only delicate API right now is `GlobalScope` (#2637).
269
269
* Fixed bug introduced in `1.4.3` when `kotlinx-coroutines-core.jar` triggered IDEA debugger failure (#2619).
270
270
* Fixed memory leak of `ChildHandlerNode` with reusable continuations (#2564).
* Search for existing issues to avoid reporting duplicates.
12
-
* When submitting a bug report:
13
-
* Test it against the most recently released version. It might have been already fixed.
14
-
* By default, we assume that your problem reproduces in Kotlin/JVM. Please, mention if the problem is
15
-
specific to Kotlin/JS or Kotlin/Native.
16
-
* Include the code that reproduces the problem. Provide the complete reproducer code, yet minimize it as much as possible.
17
-
* However, don't put off reporting any weird or rarely appearing issues just because you cannot consistently
18
-
reproduce them.
19
-
* If the bug is in behavior, then explain what behavior you've expected and what you've got.
20
-
* When submitting a feature request:
21
-
* Explain why you need the feature — what's your use-case, what's your domain.
22
-
* Explaining the problem you face is more important than suggesting a solution.
23
-
Report your problem even if you don't have any proposed solution.
24
-
* If there is an alternative way to do what you need, then show the code of the alternative.
10
+
Questions about usage and general inquiries are better suited for [StackOverflow](https://stackoverflow.com)
11
+
or the `#coroutines` channel in [KotlinLang Slack](https://surveys.jetbrains.com/s3/kotlin-slack-sign-up).
25
12
26
13
## Submitting PRs
27
14
@@ -30,21 +17,23 @@ However, please keep in mind that maintainers will have to support the resulting
30
17
so do familiarize yourself with the following guidelines.
31
18
32
19
* All development (both new features and bug fixes) is performed in the `develop` branch.
33
-
* The `master` branch always contains sources of the most recently released version.
34
-
* Base PRs against the `develop` branch.
20
+
* The `master` branch contains the sources of the most recently released version.
21
+
* Base your PRs against the `develop` branch.
35
22
* The `develop` branch is pushed to the `master` branch during release.
36
23
* Documentation in markdown files can be updated directly in the `master` branch,
37
24
unless the documentation is in the source code, and the patch changes line numbers.
38
25
* If you fix documentation:
39
26
* After fixing/changing code examples in the [`docs`](docs) folder or updating any references in the markdown files
40
27
run the [Knit tool](#running-the-knit-tool) and commit the resulting changes as well.
41
-
It will not pass the tests otherwise.
28
+
The tests will not pass otherwise.
42
29
* If you plan extensive rewrites/additions to the docs, then please [contact the maintainers](#contacting-maintainers)
43
-
to coordinate the work in advance.
30
+
to coordinate the work in advance.
44
31
* If you make any code changes:
45
32
* Follow the [Kotlin Coding Conventions](https://kotlinlang.org/docs/reference/coding-conventions.html).
46
33
Use 4 spaces for indentation.
47
-
*[Build the project](#building) to make sure it all works and passes the tests.
34
+
Do not add extra newlines in function bodies: if you feel that blocks of code should be logically separated,
35
+
then separate them with a comment instead.
36
+
*[Build the project](#building) to make sure everything works and passes the tests.
48
37
* If you fix a bug:
49
38
* Write the test that reproduces the bug.
50
39
* Fixes without tests are accepted only in exceptional circumstances if it can be shown that writing the
@@ -53,37 +42,37 @@ so do familiarize yourself with the following guidelines.
53
42
name test functions as `testXxx`. Don't use backticks in test names.
54
43
* If you introduce any new public APIs:
55
44
* Comment on the existing issue if you want to work on it or create one beforehand.
56
-
Ensure that the issue not only describes a problem, but also describes a solution that had received a positive feedback. Propose a solution if there isn't any.
57
-
PRs with new API, but without a corresponding issue with a positive feedback about the proposed implementation are unlikely to
58
-
be approved or reviewed.
45
+
Ensure that not only the issue describes a problem, but also that the proposed solution has received positive
46
+
feedback. Propose a solution if there isn't any.
47
+
PRs that add new API without a corresponding issue with positive feedback about the proposed implementation are
48
+
unlikely to be approved or reviewed.
59
49
* All new APIs must come with documentation and tests.
60
-
* All new APIs are initially released with `@ExperimentalCoroutineApi` annotation and are graduated later.
50
+
* All new APIs are initially released with the `@ExperimentalCoroutineApi` annotation and graduate later.
61
51
*[Update the public API dumps](#updating-the-public-api-dump) and commit the resulting changes as well.
62
52
It will not pass the tests otherwise.
63
-
* If you plan large API additions, then please start by submitting an issue with the proposed API design
53
+
* If you plan large API additions, then please start by submitting an issue with the proposed API design
64
54
to gather community feedback.
65
-
*[Contact the maintainers](#contacting-maintainers) to coordinate any big piece of work in advance.
66
-
* Steps for contributing new integration modules are explained [here](integration/README.md#Contributing).
55
+
*[Contact the maintainers](#contacting-maintainers) to coordinate any extensive work in advance.
67
56
68
57
## Building
69
58
70
59
This library is built with Gradle.
71
60
72
61
* Run `./gradlew build` to build. It also runs all the tests.
73
-
* Run `./gradlew <module>:test` to test the module you are looking at to speed
62
+
* Run `./gradlew <module>:check` to test the module you are looking at to speed
74
63
things up during development.
75
-
* Run `./gradlew jvmTest` to perform only fast JVM tests of the core multiplatform module.
64
+
* Run `./gradlew <module>:jvmTest` to perform only the fast JVM tests of a multiplatform module.
76
65
77
66
You can import this project into IDEA, but you have to delegate build actions
78
-
to Gradle (in Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle -> Runner)
67
+
to Gradle (in Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle -> Build and run).
79
68
80
69
### Environment requirements
81
70
82
71
* JDK >= 11 referred to by the `JAVA_HOME` environment variable.
83
72
* JDK 1.8 referred to by the `JDK_18` environment variable. Only used by nightly stress-tests.
84
-
It is OK to have `JDK_18` to a non1.8 JDK (e.g. `JAVA_HOME`) for external contributions.
73
+
It is OK to have `JDK_18`point to a non-1.8 JDK (e.g. `JAVA_HOME`) for external contributions.
85
74
86
-
For external contributions you can for example add this to your shell startup scripts (e.g. `~/.zshrc`):
75
+
For external contributions you can, for example, add this to your shell startup scripts (e.g. `~/.zshrc`):
87
76
```shell
88
77
# This assumes JAVA_HOME is set already to a JDK >= 11 version
89
78
export JDK_18="$JAVA_HOME"
@@ -92,18 +81,18 @@ export JDK_18="$JAVA_HOME"
92
81
### Running the Knit tool
93
82
94
83
* Use [Knit](https://github.com/Kotlin/kotlinx-knit/blob/main/README.md) for updates to documentation:
95
-
* Run `./gradlew knit` to update example files, links, tables of content.
96
-
* Commit updated documents and examples together with other changes.
84
+
* Run `./gradlew knit` to update the example files, links, tables of content.
85
+
* Commit the updated documents and examples together with other changes.
97
86
98
87
### Updating the public API dump
99
88
100
-
* Use [Binary Compatibility Validator](https://github.com/Kotlin/binary-compatibility-validator/blob/master/README.md) for updates to public API:
89
+
* Use the [Binary Compatibility Validator](https://github.com/Kotlin/binary-compatibility-validator/blob/master/README.md) for updates to public API:
101
90
* Run `./gradlew apiDump` to update API index files.
102
-
* Commit updated API indexes together with other changes.
91
+
* Commit the updated API indexes together with other changes.
103
92
104
93
## Releases
105
94
106
-
*Full release procedure checklist is [here](RELEASE.md).
95
+
*The full release procedure checklist is [here](RELEASE.md).
0 commit comments