kotlin-ipv8
kotlin-ipv8 copied to clipboard
Use Default dispatcher instead of Main in Community scope.
The coroutineScope in the Community class uses Dispatchers.Main. Dispatchers.Main is used to run code on the UI thread and should not be used for anything else.
Code that uses the scope without specifying the Dispatcher when launching a new task (like eva), does not work on a PC, as you need another dependency to access the Main dispatcher. https://github.com/Tribler/kotlin-ipv8/blob/f983ed48ad2bb8d9802b1a9106ef44ce63998664/ipv8/src/main/java/nl/tudelft/ipv8/messaging/eva/EVAProtocol.kt#L74
https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-dispatchers/-main.html
| File | Coverage [84.44%] | :green_apple: |
|---|---|---|
| Community.kt | 84.44% | :green_apple: |
| Total Project Coverage | 63.11% | :green_apple: |
|---|
Codecov Report
Patch coverage has no change and project coverage change: +0.21 :tada:
Comparison is base (
0623f77) 58.32% compared to head (6a40fa2) 58.53%.
Additional details and impacted files
@@ Coverage Diff @@
## master #79 +/- ##
============================================
+ Coverage 58.32% 58.53% +0.21%
- Complexity 697 702 +5
============================================
Files 107 107
Lines 4487 4546 +59
Branches 634 638 +4
============================================
+ Hits 2617 2661 +44
- Misses 1538 1550 +12
- Partials 332 335 +3
| Impacted Files | Coverage Δ | |
|---|---|---|
| ipv8/src/main/java/nl/tudelft/ipv8/Community.kt | 75.78% <ø> (+1.78%) |
:arrow_up: |
... and 7 files with indirect coverage changes
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.