Closed lukisk closed 3 months ago
Describe the bug Occasionally, the 'main stream' closes unexpectedly.
To Reproduce Steps to reproduce the behavior:
val scope = CoroutineScope(Dispatchers.Default) val store = StoreBuilder.from<Int, String>(Fetcher.of { key -> delay(10) //simulate long network request "$key :: " + Random.nextInt() }).build() scope.launch { store.stream(StoreReadRequest.cached(1, false)) //main stream .onCompletion { println("Unexpected !!!" + it) } .collect { println("result" + it) } } (1 .. 50).onEach { scope.launch { while (isActive) { store.stream(StoreReadRequest.fresh(1)) .filterNot { it is StoreReadResponse.Loading } .firstOrNull() delay(150) } } }
Expected behavior Calling 'fresh' does not cause the 'main stream' to close
Smartphone (please complete the following information):
Describe the bug Occasionally, the 'main stream' closes unexpectedly.
To Reproduce Steps to reproduce the behavior:
Expected behavior Calling 'fresh' does not cause the 'main stream' to close
Smartphone (please complete the following information):