rocketraman
11/10/2023, 1:45 PMClosedSendChannelException
in the browser, after which my VMs stop working. Its not clear from the console log where the exception is coming from. Is it perhaps an incompatibility with Kotlin 1.9.20 -- 4.0.0 appears to be compiled against 1.9.10?Casey Brooks
11/10/2023, 3:08 PMrocketraman
11/10/2023, 3:10 PMLaunchedEffect(vm /* Or Unit */) {
vm.send(Inputs.Initialize)
}
Any thoughts on why this would be a problem @Casey Brooks? It worked fine with ballast 2.x.Inputs.Initialize
via the BootstrapInterceptor
results in the same error, though with better logging as the error is caught by Ballast:
[SignIn] Uncaught error (Channel was closed)
[SignIn] Ballast error capture, input sequence types are [] BallastLoggingException: ClosedSendChannelException: Channel was closed
at protoOf.doResume_5yljmg_k$ (webpack-internal:///./kotlin/ballast-ballast-logging.js:336:31)
at protoOf.invoke_2dr2y6_k$ (webpack-internal:///./kotlin/ballast-ballast-logging.js:302:16)
at onEach$o$collect$slambda.l [as $action_1] (webpack-internal:///./kotlin/ballast-ballast-logging.js:631:16)
at protoOf.doResume_5yljmg_k$ (webpack-internal:///./kotlin/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js:16461:34)
at protoOf.invoke_oz8tte_k$ (webpack-internal:///./kotlin/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js:16443:16)
at sam$kotlinx_coroutines_flow_FlowCollector$0_10.l [as function_1] (webpack-internal:///./kotlin/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js:16502:16)
at protoOf.emit_t92u1f_k$ (webpack-internal:///./kotlin/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js:16432:17)
at protoOf.emit_t92u1f_k$ (webpack-internal:///./kotlin/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js:21105:29)
at protoOf.doResume_5yljmg_k$ (webpack-internal:///./kotlin/ballast-ballast-api.js:4040:57)
at protoOf.invoke_m1n198_k$ (webpack-internal:///./kotlin/ballast-ballast-api.js:4025:16)
Caused by: ClosedSendChannelException: Channel was closed
at protoOf.get_sendException_qpq1ry_k$ (webpack-internal:///./kotlin/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js:8743:37)
at onClosedSend (webpack-internal:///./kotlin/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js:5532:31)
at protoOf.doResume_5yljmg_k$ (webpack-internal:///./kotlin/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js:7733:37)
at protoOf.send_44jogj_k$ (webpack-internal:///./kotlin/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js:8168:16)
at protoOf.enqueue_9t430b_k$ (webpack-internal:///./kotlin/ballast-ballast-api.js:1950:30)
at protoOf.doResume_5yljmg_k$ (webpack-internal:///./kotlin/ballast-ballast-api.js:3576:88)
at protoOf.enqueueQueued_vbcpz3_k$ (webpack-internal:///./kotlin/ballast-ballast-api.js:3865:16)
at protoOf.sendToQueue_bkzj57_k$ (webpack-internal:///./kotlin/ballast-ballast-api.js:5405:30)
at protoOf.doResume_5yljmg_k$ (webpack-internal:///./kotlin/ballast-ballast-utils.js:230:48)
at protoOf.resumeWith_b9cu3x_k$ (webpack-internal:///./kotlin/kotlin-kotlin-stdlib.js:6846:34)
Casey Brooks
11/13/2023, 7:43 PMrocketraman
11/13/2023, 8:07 PMfactory
as soon as I figured out what was happening, but it was a bit surprising in the sense that "configs" are not normally tied to lifecycles.Casey Brooks
11/13/2023, 8:23 PMrocketraman
11/13/2023, 8:38 PMCasey Brooks
11/13/2023, 8:50 PMrocketraman
11/13/2023, 8:51 PMCasey Brooks
11/13/2023, 9:03 PMrocketraman
11/13/2023, 9:06 PMCasey Brooks
11/13/2023, 9:08 PMvar
vs val
propertiesrocketraman
11/13/2023, 9:10 PMconfigCreator: () -> BallastViewModelConfiguration<Inputs, Events, State>
in the VM constructor. The intended usage is then obvious to the caller, and for current API users this would be an easy change to make. It can be introduced into 4.0 by deprecating the old constructor, and then removing the old method in 5.x.