diff --git a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcDeclarationScanner.kt b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcDeclarationScanner.kt index 2c307ba0..23a0492f 100644 --- a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcDeclarationScanner.kt +++ b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcDeclarationScanner.kt @@ -81,7 +81,7 @@ internal object RpcDeclarationScanner { private fun unsupportedDeclaration(service: IrClass, declaration: IrDeclaration, logger: MessageCollector): Nothing? { logger.report( severity = CompilerMessageSeverity.LOGGING, - message = "Unsupported declaration in RemoteService interface ${service.name}: ${declaration.dumpKotlinLike()}", + message = "Unsupported declaration in @Rpc interface ${service.name}: ${declaration.dumpKotlinLike()}", ) return null diff --git a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcIrContext.kt b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcIrContext.kt index 961d5ebc..2fe32ec7 100644 --- a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcIrContext.kt +++ b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcIrContext.kt @@ -36,10 +36,6 @@ internal class RpcIrContext( getIrClassSymbol("kotlinx.coroutines", "CoroutineScope") } - val coroutineContext by lazy { - getIrClassSymbol("kotlin.coroutines", "CoroutineContext") - } - val kTypeClass by lazy { getIrClassSymbol("kotlin.reflect", "KType") } @@ -56,14 +52,6 @@ internal class RpcIrContext( getIrClassSymbol("kotlinx.coroutines.flow", "Flow") } - val sharedFlow by lazy { - getIrClassSymbol("kotlinx.coroutines.flow", "SharedFlow") - } - - val stateFlow by lazy { - getIrClassSymbol("kotlinx.coroutines.flow", "StateFlow") - } - val pair by lazy { getIrClassSymbol("kotlin", "Pair") } @@ -139,10 +127,6 @@ internal class RpcIrContext( rpcClient.namedFunction("callServerStreaming") } - val provideStubContext by lazy { - rpcClient.namedFunction("provideStubContext") - } - val asArray by lazy { rpcMethodClass.namedFunction("asArray") } @@ -155,10 +139,6 @@ internal class RpcIrContext( namedFunction("kotlin", "emptyArray") } - val scopedClientCall by lazy { - namedFunction("kotlinx.rpc.internal", "scopedClientCall") - } - val emptyList by lazy { namedFunction("kotlin.collections", "emptyList") } @@ -201,10 +181,6 @@ internal class RpcIrContext( val properties = Properties() inner class Properties { - val rpcClientCoroutineContext by lazy { - rpcClient.namedProperty("coroutineContext") - } - val rpcServiceDescriptorFqName by lazy { rpcServiceDescriptor.namedProperty("fqName") } diff --git a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcStubGenerator.kt b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcStubGenerator.kt index a4afd53d..3a74c81e 100644 --- a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcStubGenerator.kt +++ b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcStubGenerator.kt @@ -120,8 +120,6 @@ internal class RpcStubGenerator( stubIdProperty() clientProperty() - - coroutineContextProperty() } private var stubIdProperty: IrProperty by Delegates.notNull() @@ -191,64 +189,6 @@ internal class RpcStubGenerator( } } - private var coroutineContextProperty: IrProperty by Delegates.notNull() - - /** - * `coroutineContext` property from `RemoteService` interface - * - * ```kotlin - * final override val coroutineContext: CoroutineContext = __rpc_client.provideStubContext(__rpc_stub_id) - * ``` - */ - private fun IrClass.coroutineContextProperty() { - coroutineContextProperty = addProperty { - name = Name.identifier("coroutineContext") - visibility = DescriptorVisibilities.PUBLIC - modality = Modality.FINAL - }.apply { - overriddenSymbols = listOf(ctx.properties.rpcClientCoroutineContext) - - addBackingFieldUtil { - visibility = DescriptorVisibilities.PRIVATE - type = ctx.coroutineContext.defaultType - vsApi { isFinalVS = true } - }.apply { - val coroutineContextClass = ctx.coroutineContext.owner - - initializer = factory.createExpressionBody( - vsApi { - IrCallImplVS( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - type = coroutineContextClass.typeWith(), - symbol = ctx.functions.provideStubContext.symbol, - valueArgumentsCount = 1, - typeArgumentsCount = 0, - ) - }.apply { - arguments { - dispatchReceiver = irCallProperty(stubClass, clientProperty) - - values { - +irCallProperty(stubClass, stubIdProperty) - } - } - } - ) - } - - addDefaultGetter(this@coroutineContextProperty, ctx.irBuiltIns) { - val serviceCoroutineContext = declaration.service.getPropertyGetter("coroutineContext") - ?: error( - "RPC services expected to have \"coroutineContext\" property with getter: " + - declaration.service.dump() - ) - - overriddenSymbols = listOf(serviceCoroutineContext) - } - } - } - private fun IrClass.generateMethods() { declaration.methods.forEach { generateRpcMethod(it) @@ -307,8 +247,6 @@ internal class RpcStubGenerator( } } - val declaredFunction = this - val arguments = method.arguments.memoryOptimizedMap { arg -> addValueParameter { name = arg.value.name @@ -333,63 +271,19 @@ internal class RpcStubGenerator( return@irBlockBody } - +irReturn( - irCall( - callee = ctx.functions.scopedClientCall, - type = method.function.returnType, - ).apply { - // suspend lambda - // it's type is not available at runtime, but in fact exists - val lambdaType = ctx.suspendFunction0.typeWith(method.function.returnType) - - val functionLambda = factory.buildFun { - origin = IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA - name = SpecialNames.ANONYMOUS - visibility = DescriptorVisibilities.LOCAL - modality = Modality.FINAL - returnType = method.function.returnType - isSuspend = true - }.apply { - parent = declaredFunction - - body = irBuilder(symbol).irBlockBody { - val call = irRpcMethodClientCall( - method = method, - functionThisReceiver = functionThisReceiver, - isMethodObject = isMethodObject, - methodClass = methodClass, - arguments = arguments, - ) - - if (method.function.returnType == ctx.irBuiltIns.unitType) { - +call - } else { - +irReturn(call) - } - } - } - - val lambda = IrFunctionExpressionImpl( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - type = lambdaType, - origin = IrStatementOrigin.LAMBDA, - function = functionLambda, - ) - - arguments { - types { - +method.function.returnType - } - - values { - +irGet(ctx.coroutineScope.defaultType, functionThisReceiver.symbol) - - +lambda - } - } - } + val call = irRpcMethodClientCall( + method = method, + functionThisReceiver = functionThisReceiver, + isMethodObject = isMethodObject, + methodClass = methodClass, + arguments = arguments, ) + + if (method.function.returnType == ctx.irBuiltIns.unitType) { + +call + } else { + +irReturn(call) + } } } } diff --git a/compiler-plugin/compiler-plugin-common/src/main/core/kotlinx/rpc/codegen/common/Names.kt b/compiler-plugin/compiler-plugin-common/src/main/core/kotlinx/rpc/codegen/common/Names.kt index c5da2bca..6f664dfd 100644 --- a/compiler-plugin/compiler-plugin-common/src/main/core/kotlinx/rpc/codegen/common/Names.kt +++ b/compiler-plugin/compiler-plugin-common/src/main/core/kotlinx/rpc/codegen/common/Names.kt @@ -10,7 +10,6 @@ import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name object RpcClassId { - val remoteServiceInterface = ClassId(FqName("kotlinx.rpc"), Name.identifier("RemoteService")) val rpcAnnotation = ClassId(FqName("kotlinx.rpc.annotations"), Name.identifier("Rpc")) val checkedTypeAnnotation = ClassId(FqName("kotlinx.rpc.annotations"), Name.identifier("CheckedTypeAnnotation")) diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcExtensionRegistrar.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcExtensionRegistrar.kt index ae29208d..0502bf62 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcExtensionRegistrar.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcExtensionRegistrar.kt @@ -30,7 +30,5 @@ class FirRpcExtensionRegistrar(private val configuration: CompilerConfiguration) } +CFactory { FirRpcAdditionalCheckers(it, serializationIsPresent, configuration) } - - +SFactory { FirRpcSupertypeGenerator(it, logger) } } } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcSupertypeGeneratorAbstract.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcSupertypeGeneratorAbstract.kt deleted file mode 100644 index 268ce13a..00000000 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcSupertypeGeneratorAbstract.kt +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc.codegen - -import kotlinx.rpc.codegen.common.RpcClassId -import org.jetbrains.kotlin.cli.common.messages.MessageCollector -import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.FirClass -import org.jetbrains.kotlin.fir.declarations.FirClassLikeDeclaration -import org.jetbrains.kotlin.fir.declarations.utils.isInterface -import org.jetbrains.kotlin.fir.extensions.FirDeclarationPredicateRegistrar -import org.jetbrains.kotlin.fir.extensions.FirSupertypeGenerationExtension -import org.jetbrains.kotlin.fir.extensions.predicateBasedProvider -import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef -import org.jetbrains.kotlin.name.ClassId - -abstract class FirRpcSupertypeGeneratorAbstract( - session: FirSession, - @Suppress("unused") private val logger: MessageCollector, -) : FirSupertypeGenerationExtension(session) { - override fun FirDeclarationPredicateRegistrar.registerPredicates() { - register(FirRpcPredicates.rpc) - } - - override fun needTransformSupertypes(declaration: FirClassLikeDeclaration): Boolean { - return session.predicateBasedProvider.matches( - predicate = FirRpcPredicates.rpc, - declaration = declaration, - ) && declaration is FirClass && declaration.isInterface - } - - protected fun computeAdditionalSupertypesAbstract( - resolvedSupertypes: List, - ): List { - if (resolvedSupertypes.any { it.doesMatchesClassId(session, RpcClassId.remoteServiceInterface) }) { - return emptyList() - } - - return listOf(RpcClassId.remoteServiceInterface) - } -} - diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcUtils.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcUtils.kt index 20869b4c..54ed7fde 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcUtils.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcUtils.kt @@ -4,7 +4,6 @@ package kotlinx.rpc.codegen -import kotlinx.rpc.codegen.common.RpcClassId import org.jetbrains.kotlin.KtSourceElement import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.toAnnotationClassId @@ -15,17 +14,11 @@ import org.jetbrains.kotlin.fir.extensions.predicateBasedProvider import org.jetbrains.kotlin.fir.resolve.fullyExpandedType import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol import org.jetbrains.kotlin.fir.symbols.SymbolInternals -import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol import org.jetbrains.kotlin.fir.types.ConeClassLikeType -import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef import org.jetbrains.kotlin.fir.types.FirTypeRef import org.jetbrains.kotlin.fir.types.coneTypeSafe import org.jetbrains.kotlin.name.ClassId -fun FirClassSymbol<*>.isRemoteService(session: FirSession): Boolean = resolvedSuperTypeRefs.any { - it.doesMatchesClassId(session, RpcClassId.remoteServiceInterface) -} - fun FirBasedSymbol<*>.rpcAnnotationSource( session: FirSession, predicate: DeclarationPredicate, @@ -53,14 +46,6 @@ fun List.rpcAnnotation(session: FirSession, predicate: Declaratio } } -fun FirClassSymbol<*>.remoteServiceSupertypeSource(session: FirSession): KtSourceElement? { - return remoteServiceSupertype(session)?.source -} - -fun FirClassSymbol<*>.remoteServiceSupertype(session: FirSession): FirResolvedTypeRef? { - return resolvedSuperTypeRefs.find { it.doesMatchesClassId(session, RpcClassId.remoteServiceInterface) } -} - @OptIn(SymbolInternals::class) internal fun FirTypeRef.doesMatchesClassId(session: FirSession, classId: ClassId): Boolean { return coneTypeSafe()?.fullyExpandedType(session)?.lookupTag?.classId == classId diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcAnnotationChecker.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcAnnotationChecker.kt index edf1ca50..8049d18e 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcAnnotationChecker.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcAnnotationChecker.kt @@ -8,8 +8,6 @@ import kotlinx.rpc.codegen.FirCheckersContext import kotlinx.rpc.codegen.FirRpcPredicates import kotlinx.rpc.codegen.checkers.diagnostics.FirRpcDiagnostics import kotlinx.rpc.codegen.common.RpcClassId -import kotlinx.rpc.codegen.isRemoteService -import kotlinx.rpc.codegen.remoteServiceSupertypeSource import kotlinx.rpc.codegen.rpcAnnotation import kotlinx.rpc.codegen.rpcAnnotationSource import org.jetbrains.kotlin.descriptors.ClassKind @@ -51,14 +49,6 @@ object FirRpcAnnotationChecker { ) } - if (declaration.symbol.isRemoteService(context.session) && !rpcAnnotated) { - reporter.reportOn( - source = declaration.symbol.remoteServiceSupertypeSource(context.session), - factory = FirRpcDiagnostics.MISSING_RPC_ANNOTATION, - context = context, - ) - } - if (rpcAnnotated && !ctx.serializationIsPresent && isMetaAnnotated) { reporter.reportOn( source = declaration.symbol.rpcAnnotationSource( diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/FirRpcDiagnostics.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/FirRpcDiagnostics.kt index adada641..fc566800 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/FirRpcDiagnostics.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/FirRpcDiagnostics.kt @@ -26,7 +26,6 @@ import org.jetbrains.kotlin.psi.KtElement // ########################################################################### object FirRpcDiagnostics : RpcKtDiagnosticsContainer() { - val MISSING_RPC_ANNOTATION by error0() val MISSING_SERIALIZATION_MODULE by error0() val WRONG_RPC_ANNOTATION_TARGET by error1() val CHECKED_ANNOTATION_VIOLATION by error3>() diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/RpcDiagnosticRendererFactory.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/RpcDiagnosticRendererFactory.kt index 792fb24d..0a1b8d9f 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/RpcDiagnosticRendererFactory.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/RpcDiagnosticRendererFactory.kt @@ -12,13 +12,6 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers object RpcDiagnosticRendererFactory : BaseDiagnosticRendererFactory() { override val MAP by RpcKtDiagnosticFactoryToRendererMap("Rpc") { map -> - map.put( - factory = FirRpcDiagnostics.MISSING_RPC_ANNOTATION, - message = "Missing @Rpc annotation. " + - "All services children of kotlinx.rpc.RemoteService " + - "must be annotated with kotlinx.rpc.annotations.Rpc", - ) - map.put( factory = FirRpcDiagnostics.MISSING_SERIALIZATION_MODULE, message = "Missing kotlinx.serialization plugin in the module. " + diff --git a/compiler-plugin/compiler-plugin-k2/src/main/latest/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt b/compiler-plugin/compiler-plugin-k2/src/main/latest/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt deleted file mode 100644 index 90269d1d..00000000 --- a/compiler-plugin/compiler-plugin-k2/src/main/latest/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc.codegen - -import org.jetbrains.kotlin.cli.common.messages.MessageCollector -import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.FirClassLikeDeclaration -import org.jetbrains.kotlin.fir.types.ConeKotlinType -import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef -import org.jetbrains.kotlin.fir.types.constructClassLikeType - -class FirRpcSupertypeGenerator( - session: FirSession, - logger: MessageCollector, -) : FirRpcSupertypeGeneratorAbstract(session, logger) { - override fun computeAdditionalSupertypes( - classLikeDeclaration: FirClassLikeDeclaration, - resolvedSupertypes: List, - typeResolver: TypeResolveService, - ): List { - return computeAdditionalSupertypesAbstract(resolvedSupertypes).map { - it.constructClassLikeType(emptyArray(), isMarkedNullable = false) - } - } -} diff --git a/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt b/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt deleted file mode 100644 index 04b2667f..00000000 --- a/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc.codegen - -import org.jetbrains.kotlin.cli.common.messages.MessageCollector -import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.FirClassLikeDeclaration -import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef -import org.jetbrains.kotlin.fir.types.constructClassLikeType - -class FirRpcSupertypeGenerator( - session: FirSession, - logger: MessageCollector, -) : FirRpcSupertypeGeneratorAbstract(session, logger) { - override fun computeAdditionalSupertypes( - classLikeDeclaration: FirClassLikeDeclaration, - resolvedSupertypes: List, - typeResolver: TypeResolveService, - ): List { - return computeAdditionalSupertypesAbstract(resolvedSupertypes).map { - vsApi { - it.constructClassLikeType(emptyArray(), isNullable = false).toFirResolvedTypeRefVS() - } - } - } -} diff --git a/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_21/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt b/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_21/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt deleted file mode 100644 index 04b2667f..00000000 --- a/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_21/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc.codegen - -import org.jetbrains.kotlin.cli.common.messages.MessageCollector -import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.FirClassLikeDeclaration -import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef -import org.jetbrains.kotlin.fir.types.constructClassLikeType - -class FirRpcSupertypeGenerator( - session: FirSession, - logger: MessageCollector, -) : FirRpcSupertypeGeneratorAbstract(session, logger) { - override fun computeAdditionalSupertypes( - classLikeDeclaration: FirClassLikeDeclaration, - resolvedSupertypes: List, - typeResolver: TypeResolveService, - ): List { - return computeAdditionalSupertypesAbstract(resolvedSupertypes).map { - vsApi { - it.constructClassLikeType(emptyArray(), isNullable = false).toFirResolvedTypeRefVS() - } - } - } -} diff --git a/compiler-plugin/compiler-plugin-k2/src/main/v_2_2/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt b/compiler-plugin/compiler-plugin-k2/src/main/v_2_2/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt deleted file mode 100644 index 90269d1d..00000000 --- a/compiler-plugin/compiler-plugin-k2/src/main/v_2_2/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc.codegen - -import org.jetbrains.kotlin.cli.common.messages.MessageCollector -import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.FirClassLikeDeclaration -import org.jetbrains.kotlin.fir.types.ConeKotlinType -import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef -import org.jetbrains.kotlin.fir.types.constructClassLikeType - -class FirRpcSupertypeGenerator( - session: FirSession, - logger: MessageCollector, -) : FirRpcSupertypeGeneratorAbstract(session, logger) { - override fun computeAdditionalSupertypes( - classLikeDeclaration: FirClassLikeDeclaration, - resolvedSupertypes: List, - typeResolver: TypeResolveService, - ): List { - return computeAdditionalSupertypesAbstract(resolvedSupertypes).map { - it.constructClassLikeType(emptyArray(), isMarkedNullable = false) - } - } -} diff --git a/compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt b/compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt deleted file mode 100644 index 90269d1d..00000000 --- a/compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc.codegen - -import org.jetbrains.kotlin.cli.common.messages.MessageCollector -import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.FirClassLikeDeclaration -import org.jetbrains.kotlin.fir.types.ConeKotlinType -import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef -import org.jetbrains.kotlin.fir.types.constructClassLikeType - -class FirRpcSupertypeGenerator( - session: FirSession, - logger: MessageCollector, -) : FirRpcSupertypeGeneratorAbstract(session, logger) { - override fun computeAdditionalSupertypes( - classLikeDeclaration: FirClassLikeDeclaration, - resolvedSupertypes: List, - typeResolver: TypeResolveService, - ): List { - return computeAdditionalSupertypesAbstract(resolvedSupertypes).map { - it.constructClassLikeType(emptyArray(), isMarkedNullable = false) - } - } -} diff --git a/core/api/core.api b/core/api/core.api index 6623d843..29a9fc7d 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -9,7 +9,7 @@ public final class kotlinx/rpc/RegisterFieldKt { public static final fun registerStateFlowField (Lkotlinx/rpc/RpcClient;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/rpc/descriptor/RpcServiceDescriptor;Ljava/lang/String;J)Lkotlinx/coroutines/flow/StateFlow; } -public abstract interface class kotlinx/rpc/RemoteService : kotlinx/coroutines/CoroutineScope { +public abstract interface class kotlinx/rpc/RemoteService { } public final class kotlinx/rpc/RpcCall { @@ -29,22 +29,17 @@ public final class kotlinx/rpc/RpcCall { public fun toString ()Ljava/lang/String; } -public abstract interface class kotlinx/rpc/RpcClient : kotlinx/coroutines/CoroutineScope { +public abstract interface class kotlinx/rpc/RpcClient { public abstract fun call (Lkotlinx/rpc/RpcCall;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract fun callAsync (Lkotlinx/coroutines/CoroutineScope;Lkotlinx/rpc/RpcCall;)Lkotlinx/coroutines/Deferred; public abstract fun callServerStreaming (Lkotlinx/rpc/RpcCall;)Lkotlinx/coroutines/flow/Flow; - public abstract fun provideStubContext (J)Lkotlin/coroutines/CoroutineContext; -} - -public final class kotlinx/rpc/RpcClient$DefaultImpls { - public static fun callServerStreaming (Lkotlinx/rpc/RpcClient;Lkotlinx/rpc/RpcCall;)Lkotlinx/coroutines/flow/Flow; } public abstract interface annotation class kotlinx/rpc/RpcEagerField : java/lang/annotation/Annotation { } -public abstract interface class kotlinx/rpc/RpcServer : kotlinx/coroutines/CoroutineScope { - public abstract fun registerService (Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function1;)V +public abstract interface class kotlinx/rpc/RpcServer { + public abstract fun deregisterService (Lkotlin/reflect/KClass;)V + public abstract fun registerService (Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function0;)V } public final class kotlinx/rpc/UninitializedRpcFieldException : java/lang/Exception { diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/RemoteService.kt b/core/src/commonMain/kotlin/kotlinx/rpc/RemoteService.kt index 71f3ceae..ccb3512a 100644 --- a/core/src/commonMain/kotlin/kotlinx/rpc/RemoteService.kt +++ b/core/src/commonMain/kotlin/kotlinx/rpc/RemoteService.kt @@ -4,15 +4,12 @@ package kotlinx.rpc -import kotlinx.coroutines.CoroutineScope import kotlinx.rpc.annotations.Rpc /** * Marker interface for an RPC service. - * Provides type safety and [CoroutineScope] for [Rpc] annotated services. - * - * Every [RemoteService] service MUST be annotated with [Rpc] annotation. * * @see Rpc */ -public interface RemoteService : CoroutineScope +@Deprecated("Use of RemoteService is deprecated. Use only @Rpc annotation", level = DeprecationLevel.ERROR) +public interface RemoteService diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/RpcClient.kt b/core/src/commonMain/kotlin/kotlinx/rpc/RpcClient.kt index e33c985b..666ba795 100644 --- a/core/src/commonMain/kotlin/kotlinx/rpc/RpcClient.kt +++ b/core/src/commonMain/kotlin/kotlinx/rpc/RpcClient.kt @@ -5,9 +5,7 @@ package kotlinx.rpc import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Deferred import kotlinx.coroutines.flow.Flow -import kotlin.coroutines.CoroutineContext @Deprecated("Use RpcClient instead", ReplaceWith("RpcClient"), level = DeprecationLevel.ERROR) public typealias RPCClient = RpcClient @@ -17,7 +15,7 @@ public typealias RPCClient = RpcClient * transform them, send to the server and handle responses and errors. * [CoroutineScope] defines the lifetime of the client. */ -public interface RpcClient : CoroutineScope { +public interface RpcClient { /** * This method is used by generated clients to perform a call to the server. * @@ -38,13 +36,4 @@ public interface RpcClient : CoroutineScope { * @return the actual result of the call, for example, data from the server */ public fun callServerStreaming(call: RpcCall): Flow - - /** - * Provides child [CoroutineContext] for a new [RemoteService] service stub. - * - * This function shouldn't be called directly. - * - * @param serviceId id of the new service. Used for service cancellation messages. - */ - public fun provideStubContext(serviceId: Long): CoroutineContext } diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/RpcServer.kt b/core/src/commonMain/kotlin/kotlinx/rpc/RpcServer.kt index 887a5b29..b48910db 100644 --- a/core/src/commonMain/kotlin/kotlinx/rpc/RpcServer.kt +++ b/core/src/commonMain/kotlin/kotlinx/rpc/RpcServer.kt @@ -4,9 +4,7 @@ package kotlinx.rpc -import kotlinx.coroutines.CoroutineScope import kotlinx.rpc.annotations.Rpc -import kotlin.coroutines.CoroutineContext import kotlin.reflect.KClass @Deprecated("Use RpcServer instead", ReplaceWith("RpcServer"), level = DeprecationLevel.ERROR) @@ -15,9 +13,8 @@ public typealias RPCServer = RpcServer /** * RpcServer is used to accept RPC messages, route them to a specific service, and process given responses. * Server may contain multiple services. - * [CoroutineScope] defines server lifetime. */ -public interface RpcServer : CoroutineScope { +public interface RpcServer { /** * Registers new service to the server. Server will route all designated messages to it. * Service of any type should be unique on the server, but RpcServer doesn't specify the actual retention policy. @@ -30,7 +27,11 @@ public interface RpcServer : CoroutineScope { */ public fun <@Rpc Service : Any> registerService( serviceKClass: KClass, - serviceFactory: (CoroutineContext) -> Service, + serviceFactory: () -> Service, + ) + + public fun <@Rpc Service : Any> deregisterService( + serviceKClass: KClass, ) } @@ -44,7 +45,7 @@ public interface RpcServer : CoroutineScope { * @param serviceFactory function that produces the actual implementation of the service that will handle the calls. */ public inline fun <@Rpc reified Service : Any> RpcServer.registerService( - noinline serviceFactory: (CoroutineContext) -> Service, + noinline serviceFactory: () -> Service, ) { registerService(Service::class, serviceFactory) } diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/annotations/Rpc.kt b/core/src/commonMain/kotlin/kotlinx/rpc/annotations/Rpc.kt index d122b185..35f3441e 100644 --- a/core/src/commonMain/kotlin/kotlinx/rpc/annotations/Rpc.kt +++ b/core/src/commonMain/kotlin/kotlinx/rpc/annotations/Rpc.kt @@ -4,22 +4,15 @@ package kotlinx.rpc.annotations -import kotlinx.rpc.RemoteService - /** * Every [Rpc] annotated interface will have a code generation process run on it, * making the interface effectively usable for RPC calls. * - * Every [Rpc] annotated interface MAY inherit from the [RemoteService] interface. - * If it is not done explicitly, the supertype will be added during the compilation process. - * In that case an IDE will highlight false-positive type mismatch errors, - * so it is recommended to add the [RemoteService] parent explicitly, until proper IDE support is provided. - * * Example usage: * ```kotlin * // common code * @Rpc - * interface MyService : RemoteService { + * interface MyService { * suspend fun sayHello(firstName: String, lastName: String, age: Int): String * } * // client code @@ -27,16 +20,14 @@ import kotlinx.rpc.RemoteService * val myService = rpcClient.withService() * val greetingFromServer = myService.sayHello("Alex", "Smith", 35) * // server code - * class MyServiceImpl(override val coroutineContext: CoroutineContext) : MyService { + * class MyServiceImpl : MyService { * override suspend fun sayHello(firstName: String, lastName: String, age: Int): String { * return "Hello, $firstName $lastName, of age $age. I am your server!" * } * } * val server: RpcServer - * server.registerService { ctx -> MyServiceImpl(ctx) } + * server.registerService { MyServiceImpl() } * ``` - * - * @see [RemoteService] */ @CheckedTypeAnnotation @Target(AnnotationTarget.CLASS, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.TYPE_PARAMETER) diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/internal/ServiceScope.kt b/core/src/commonMain/kotlin/kotlinx/rpc/internal/ServiceScope.kt deleted file mode 100644 index 3c496a66..00000000 --- a/core/src/commonMain/kotlin/kotlinx/rpc/internal/ServiceScope.kt +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc.internal - -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.currentCoroutineContext -import kotlinx.coroutines.withContext -import kotlinx.rpc.internal.utils.InternalRpcApi -import kotlin.contracts.ExperimentalContracts -import kotlin.contracts.InvocationKind -import kotlin.contracts.contract -import kotlin.coroutines.CoroutineContext - -@InternalRpcApi -public class ServiceScope(public val serviceCoroutineScope: CoroutineScope) : CoroutineContext.Element { - internal companion object Key : CoroutineContext.Key - - override val key: CoroutineContext.Key<*> = Key -} - -@InternalRpcApi -public suspend fun createServiceScope(serviceCoroutineScope: CoroutineScope): ServiceScope { - val context = currentCoroutineContext() - - if (context[ServiceScope.Key] != null) { - error("serviceScoped nesting is not allowed") - } - - return ServiceScope(serviceCoroutineScope) -} - -@InternalRpcApi -public suspend fun serviceScopeOrNull(): ServiceScope? { - return currentCoroutineContext()[ServiceScope.Key] -} - -@InternalRpcApi -@OptIn(ExperimentalContracts::class) -public suspend inline fun serviceScoped( - serviceCoroutineScope: CoroutineScope, - noinline block: suspend CoroutineScope.() -> T, -): T { - contract { - callsInPlace(block, InvocationKind.EXACTLY_ONCE) - } - - return withContext(createServiceScope(serviceCoroutineScope), block) -} diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/internal/scopedClientCall.kt b/core/src/commonMain/kotlin/kotlinx/rpc/internal/scopedClientCall.kt deleted file mode 100644 index 8a47691e..00000000 --- a/core/src/commonMain/kotlin/kotlinx/rpc/internal/scopedClientCall.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc.internal - -import kotlinx.coroutines.CoroutineScope -import kotlinx.rpc.internal.utils.InternalRpcApi - -/** - * Scopes client RPC call from a service with [serviceScope]. - * - * Used by code generators. - */ -@InternalRpcApi -@Suppress("unused") -public suspend inline fun scopedClientCall(serviceScope: CoroutineScope, crossinline body: suspend () -> T): T { - return serviceScoped(serviceScope) { - body() - } -} diff --git a/krpc/krpc-client/api/krpc-client.api b/krpc/krpc-client/api/krpc-client.api index 42ce0788..3f308207 100644 --- a/krpc/krpc-client/api/krpc-client.api +++ b/krpc/krpc-client/api/krpc-client.api @@ -1,11 +1,6 @@ -public abstract class kotlinx/rpc/krpc/client/KrpcClient : kotlinx/rpc/krpc/internal/KrpcServiceHandler, kotlinx/rpc/RpcClient, kotlinx/rpc/krpc/internal/KrpcEndpoint { +public abstract class kotlinx/rpc/krpc/client/KrpcClient : kotlinx/rpc/RpcClient, kotlinx/rpc/krpc/internal/KrpcEndpoint { public fun (Lkotlinx/rpc/krpc/KrpcConfig$Client;Lkotlinx/rpc/krpc/KrpcTransport;)V public final fun call (Lkotlinx/rpc/RpcCall;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public fun callAsync (Lkotlinx/coroutines/CoroutineScope;Lkotlinx/rpc/RpcCall;)Lkotlinx/coroutines/Deferred; - public fun callServerStreaming (Lkotlinx/rpc/RpcCall;)Lkotlinx/coroutines/flow/Flow; - protected final fun getConfig ()Lkotlinx/rpc/krpc/KrpcConfig$Client; - public synthetic fun getConfig ()Lkotlinx/rpc/krpc/KrpcConfig; - public final fun getCoroutineContext ()Lkotlin/coroutines/CoroutineContext; - protected final fun getLogger ()Lkotlinx/rpc/krpc/internal/logging/RpcInternalCommonLogger; + public final fun callServerStreaming (Lkotlinx/rpc/RpcCall;)Lkotlinx/coroutines/flow/Flow; } diff --git a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/KrpcClient.kt b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/KrpcClient.kt index dff4a949..e77de945 100644 --- a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/KrpcClient.kt +++ b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/KrpcClient.kt @@ -11,8 +11,6 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.FlowCollector import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.flow -import kotlinx.coroutines.sync.Mutex -import kotlinx.coroutines.sync.withLock import kotlinx.rpc.RpcCall import kotlinx.rpc.RpcClient import kotlinx.rpc.annotations.Rpc @@ -34,9 +32,8 @@ import kotlinx.serialization.SerialFormat import kotlinx.serialization.StringFormat import kotlinx.serialization.modules.SerializersModule import kotlin.collections.first -import kotlin.coroutines.CoroutineContext +import kotlin.concurrent.Volatile import kotlin.coroutines.cancellation.CancellationException -import kotlin.time.Duration.Companion.seconds @Deprecated("Use KrpcClient instead", ReplaceWith("KrpcClient"), level = DeprecationLevel.ERROR) public typealias KRPCClient = KrpcClient @@ -54,7 +51,7 @@ public typealias KRPCClient = KrpcClient * class MyClient(config: RpcConfig.Client): KrpcClient(config, MyTransport()) * ``` * - * @property config configuration provided for that specific client. Applied to all services that use this client. + * @param config configuration provided for that specific client. Applied to all services that use this client. * @param transport [KrpcTransport] instance that will be used to send and receive RPC messages. * IMPORTANT: Must be exclusive to this client, otherwise unexpected behavior may occur. */ @@ -63,9 +60,10 @@ public abstract class KrpcClient( private val config: KrpcConfig.Client, transport: KrpcTransport, ) : RpcClient, KrpcEndpoint { - // we make a child here, so we can send cancellation messages before closing the connection - final override val coroutineContext: CoroutineContext = SupervisorJob(transport.coroutineContext.job) + @InternalRpcApi + public val internalScope: CoroutineScope = CoroutineScope(SupervisorJob(transport.coroutineContext.job)) + // we make a child here, so we can send cancellation messages before closing the connection private val connector by lazy { KrpcClientConnector(config.serialFormatInitializer.build(), transport, config.waitForServices) } @@ -82,43 +80,34 @@ public abstract class KrpcClient( private val serverSupportedPlugins: CompletableDeferred> = CompletableDeferred() + private val requestChannels = RpcInternalConcurrentHashMap>() + @InternalRpcApi final override val supportedPlugins: Set get() = serverSupportedPlugins.getOrNull() ?: emptySet() - private var clientCancelled = false - // callId to serviceTypeString private val cancellingRequests = RpcInternalConcurrentHashMap() + @Volatile + private var clientCancelled = false + init { - coroutineContext.job.invokeOnCompletion(onCancelling = true) { + internalScope.coroutineContext.job.invokeOnCompletion(onCancelling = true) { clientCancelled = true sendCancellation(CancellationType.ENDPOINT, null, null, closeTransportAfterSending = true) - } - launch { - connector.subscribeToGenericMessages(::handleGenericMessage) + requestChannels.values.forEach { it.close(CancellationException("Client cancelled")) } + requestChannels.clear() } - } - - @OptIn(InternalCoroutinesApi::class) - @InternalRpcApi - final override fun provideStubContext(serviceId: Long): CoroutineContext { - val childContext = SupervisorJob(coroutineContext.job) - childContext.job.invokeOnCompletion(onCancelling = true) { - if (!clientCancelled) { - // cancellation only by serviceId - sendCancellation(CancellationType.SERVICE, serviceId.toString(), null) - } + internalScope.launch(CoroutineName("krpc-client-generic-messages")) { + connector.subscribeToGenericMessages(::handleGenericMessage) } - - return childContext } - private val initHandshake: Job = launch { + private val initHandshake: Job = internalScope.launch(CoroutineName("krpc-client-handshake")) { connector.sendMessage(KrpcProtocolMessage.Handshake(KrpcPlugin.ALL)) connector.subscribeToProtocolMessages(::handleProtocolMessage) @@ -159,7 +148,7 @@ public abstract class KrpcClient( } @Suppress("detekt.CyclomaticComplexMethod") - override fun callServerStreaming(call: RpcCall): Flow { + final override fun callServerStreaming(call: RpcCall): Flow { return flow { awaitHandshakeCompletion() @@ -172,6 +161,9 @@ public abstract class KrpcClient( val channel = Channel() try { + @Suppress("UNCHECKED_CAST") + requestChannels[callId] = channel as Channel + val request = serializeRequest( callId = callId, call = call, @@ -180,12 +172,16 @@ public abstract class KrpcClient( pluginParams = mapOf(KrpcPluginKey.NON_SUSPENDING_SERVER_FLOW_MARKER to ""), ) - connector.sendMessage(request) - connector.subscribeToCallResponse(call.descriptor.fqName, callId) { message -> - handleServerStreamingMessage(message, channel, callable, call, callId) + if (cancellingRequests.containsKey(callId)) { + return@subscribeToCallResponse + } + + handleServerStreamingMessage(message, channel, callable) } + connector.sendMessage(request) + coroutineScope { val clientStreamsJob = launch(CoroutineName("client-stream-root-${call.serviceId}-$callId")) { supervisorScope { @@ -195,7 +191,6 @@ public abstract class KrpcClient( } } } - println("finished client streams job") } try { @@ -206,13 +201,20 @@ public abstract class KrpcClient( } } } catch (e: CancellationException) { - // sendCancellation is not suspending, so no need for NonCancellable - sendCancellation(CancellationType.REQUEST, call.serviceId.toString(), callId) - connector.unsubscribeFromMessages(call.descriptor.fqName, callId) + if (!clientCancelled) { + cancellingRequests[callId] = call.descriptor.fqName + + sendCancellation(CancellationType.REQUEST, call.descriptor.fqName, callId) + + connector.unsubscribeFromMessages(call.descriptor.fqName, callId) { + cancellingRequests.remove(callId) + } + } throw e } finally { channel.close() + requestChannels.remove(callId) } } } @@ -235,8 +237,6 @@ public abstract class KrpcClient( message: KrpcCallMessage, channel: Channel, callable: RpcCallable, - call: RpcCall, - callId: String, ) { when (message) { is KrpcCallMessage.CallData -> { @@ -270,12 +270,10 @@ public abstract class KrpcClient( } is KrpcCallMessage.StreamFinished -> { - connector.unsubscribeFromMessages(call.descriptor.fqName, callId) channel.close() } is KrpcCallMessage.StreamCancel -> { - connector.unsubscribeFromMessages(call.descriptor.fqName, callId) val cause = message.cause.deserialize() channel.close(cause) } @@ -286,15 +284,7 @@ public abstract class KrpcClient( final override suspend fun handleCancellation(message: KrpcGenericMessage) { when (val type = message.cancellationType()) { CancellationType.ENDPOINT -> { - cancel("Closing client after server cancellation") // we cancel this client - } - - CancellationType.CANCELLATION_ACK -> { - val callId = message[KrpcPluginKey.CANCELLATION_ID] - ?: error("Expected CANCELLATION_ID for cancellation of type 'request'") - - val serviceTypeString = cancellingRequests.remove(callId) ?: return - connector.unsubscribeFromMessages(serviceTypeString, callId) + internalScope.cancel("Closing client after server cancellation") // we cancel this client } else -> { @@ -402,7 +392,6 @@ public abstract class KrpcClient( outgoingStream: StreamCall, ) { flow.collect { - println("collected: $it, ${outgoingStream.streamId}") val message = when (serialFormat) { is StringFormat -> { val stringData = serialFormat.encodeToString(outgoingStream.elementSerializer, it) diff --git a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/internal/ClientStreamContext.kt b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/internal/ClientStreamContext.kt index 2ca48eea..772588d8 100644 --- a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/internal/ClientStreamContext.kt +++ b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/internal/ClientStreamContext.kt @@ -7,34 +7,31 @@ package kotlinx.rpc.krpc.client.internal import kotlinx.atomicfu.atomic import kotlinx.coroutines.flow.Flow import kotlinx.rpc.internal.utils.map.RpcInternalConcurrentHashMap +import kotlinx.rpc.internal.utils.thread.RpcInternalThreadLocal import kotlinx.serialization.KSerializer -import kotlin.native.concurrent.ThreadLocal internal class ClientStreamContext(private val connectionId: Long?) { val streams = RpcInternalConcurrentHashMap>() - @ThreadLocal - private var currentCallId: String? = null - - @ThreadLocal - private var currentServiceId: Long? = null + private val currentCallId = RpcInternalThreadLocal() + private val currentServiceId = RpcInternalThreadLocal() fun scoped(callId: String, serviceId: Long, body: () -> T): T { try { - currentCallId = callId - currentServiceId = serviceId + currentCallId.set(callId) + currentServiceId.set(serviceId) return body() } finally { - currentCallId = null - currentServiceId = null + currentCallId.remove() + currentServiceId.remove() } } private val streamIdCounter = atomic(0L) fun registerClientStream(value: Flow<*>, elementKind: KSerializer<*>): String { - val callId = currentCallId ?: error("No call id") - val serviceId = currentServiceId ?: error("No service id") + val callId = currentCallId.get() ?: error("No call id") + val serviceId = currentServiceId.get() ?: error("No service id") val streamId = "$STREAM_ID_PREFIX${streamIdCounter.getAndIncrement()}" @Suppress("UNCHECKED_CAST") diff --git a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/internal/KrpcClientConnector.kt b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/internal/KrpcClientConnector.kt index 105ead2e..ebee09b5 100644 --- a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/internal/KrpcClientConnector.kt +++ b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/internal/KrpcClientConnector.kt @@ -36,9 +36,8 @@ internal class KrpcClientConnector private constructor( } ) - @Suppress("unused") - fun unsubscribeFromMessages(serviceTypeString: String, callId: String) { - connector.unsubscribeFromMessages(CallSubscriptionId.Service(serviceTypeString, callId)) + fun unsubscribeFromMessages(serviceTypeString: String, callId: String, callback: () -> Unit = {}) { + connector.unsubscribeFromMessages(CallSubscriptionId.Service(serviceTypeString, callId), callback) } suspend fun subscribeToCallResponse( diff --git a/krpc/krpc-core/api/krpc-core.api b/krpc/krpc-core/api/krpc-core.api index 517af2dd..7b7696b1 100644 --- a/krpc/krpc-core/api/krpc-core.api +++ b/krpc/krpc-core/api/krpc-core.api @@ -1,29 +1,23 @@ public abstract interface class kotlinx/rpc/krpc/KrpcConfig { public abstract fun getSerialFormatInitializer ()Lkotlinx/rpc/krpc/serialization/KrpcSerialFormatBuilder; - public abstract fun getSharedFlowBuilder ()Lkotlin/jvm/functions/Function0; public abstract fun getWaitForServices ()Z } public final class kotlinx/rpc/krpc/KrpcConfig$Client : kotlinx/rpc/krpc/KrpcConfig { public fun getSerialFormatInitializer ()Lkotlinx/rpc/krpc/serialization/KrpcSerialFormatBuilder; - public fun getSharedFlowBuilder ()Lkotlin/jvm/functions/Function0; public fun getWaitForServices ()Z } public final class kotlinx/rpc/krpc/KrpcConfig$Server : kotlinx/rpc/krpc/KrpcConfig { public fun getSerialFormatInitializer ()Lkotlinx/rpc/krpc/serialization/KrpcSerialFormatBuilder; - public fun getSharedFlowBuilder ()Lkotlin/jvm/functions/Function0; public fun getWaitForServices ()Z } public abstract class kotlinx/rpc/krpc/KrpcConfigBuilder { - protected final fun getSharedFlowBuilder ()Lkotlin/jvm/functions/Function0; public final fun getWaitForServices ()Z protected final fun rpcSerialFormat ()Lkotlinx/rpc/krpc/serialization/KrpcSerialFormatBuilder; public final fun serialization (Lkotlin/jvm/functions/Function1;)V - protected final fun setSharedFlowBuilder (Lkotlin/jvm/functions/Function0;)V public final fun setWaitForServices (Z)V - public final fun sharedFlowParameters (Lkotlin/jvm/functions/Function1;)V } public final class kotlinx/rpc/krpc/KrpcConfigBuilder$Client : kotlinx/rpc/krpc/KrpcConfigBuilder { @@ -36,17 +30,6 @@ public final class kotlinx/rpc/krpc/KrpcConfigBuilder$Server : kotlinx/rpc/krpc/ public final fun build ()Lkotlinx/rpc/krpc/KrpcConfig$Server; } -public final class kotlinx/rpc/krpc/KrpcConfigBuilder$SharedFlowParametersBuilder { - public static final field DEFAULT_EXTRA_BUFFER_CAPACITY I - public static final field DEFAULT_REPLAY I - public final fun getExtraBufferCapacity ()I - public final fun getOnBufferOverflow ()Lkotlinx/coroutines/channels/BufferOverflow; - public final fun getReplay ()I - public final fun setExtraBufferCapacity (I)V - public final fun setOnBufferOverflow (Lkotlinx/coroutines/channels/BufferOverflow;)V - public final fun setReplay (I)V -} - public final class kotlinx/rpc/krpc/KrpcConfigKt { public static final fun rpcClientConfig (Lkotlin/jvm/functions/Function1;)Lkotlinx/rpc/krpc/KrpcConfig$Client; public static synthetic fun rpcClientConfig$default (Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lkotlinx/rpc/krpc/KrpcConfig$Client; @@ -56,12 +39,11 @@ public final class kotlinx/rpc/krpc/KrpcConfigKt { public abstract interface class kotlinx/rpc/krpc/KrpcTransport : kotlinx/coroutines/CoroutineScope { public abstract fun receive (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract fun receiveCatching-IoAF18A (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun send (Lkotlinx/rpc/krpc/KrpcTransportMessage;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } -public final class kotlinx/rpc/krpc/KrpcTransport$DefaultImpls { - public static fun receiveCatching-IoAF18A (Lkotlinx/rpc/krpc/KrpcTransport;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +public final class kotlinx/rpc/krpc/KrpcTransportKt { + public static final fun receiveCatching (Lkotlinx/rpc/krpc/KrpcTransport;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } public abstract interface class kotlinx/rpc/krpc/KrpcTransportMessage { @@ -77,15 +59,3 @@ public final class kotlinx/rpc/krpc/KrpcTransportMessage$StringMessage : kotlinx public final fun getValue ()Ljava/lang/String; } -public final class kotlinx/rpc/krpc/StreamScope : java/lang/AutoCloseable { - public fun close ()V -} - -public final class kotlinx/rpc/krpc/StreamScopeKt { - public static final fun StreamScope (Lkotlin/coroutines/CoroutineContext;)Lkotlinx/rpc/krpc/StreamScope; - public static final fun invokeOnStreamScopeCompletion (ZLkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun invokeOnStreamScopeCompletion$default (ZLkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static final fun streamScoped (Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static final fun withStreamScope (Lkotlinx/rpc/krpc/StreamScope;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; -} - diff --git a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/KrpcTransport.kt b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/KrpcTransport.kt index 0a5b1567..6e07719e 100644 --- a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/KrpcTransport.kt +++ b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/KrpcTransport.kt @@ -49,13 +49,13 @@ public interface KrpcTransport : CoroutineScope { * @return received RPC message. */ public suspend fun receive(): KrpcTransportMessage +} - /** - * Suspends until next RPC message from a peer endpoint is received and then returns it. - * - * @return received RPC message as a [Result]. - */ - public suspend fun receiveCatching(): Result { - return runCatching { receive() } - } +/** + * Suspends until next RPC message from a peer endpoint is received and then returns it. + * + * @return received RPC message as a [Result]. + */ +public suspend fun KrpcTransport.receiveCatching(): Result { + return runCatching { receive() } } diff --git a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/CancellationType.kt b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/CancellationType.kt index 9855e3c6..b268df71 100644 --- a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/CancellationType.kt +++ b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/CancellationType.kt @@ -11,8 +11,10 @@ import kotlinx.rpc.internal.utils.InternalRpcApi @Suppress("detekt.MagicNumber") public enum class CancellationType(override val uniqueIndex: Int) : RpcInternalIndexedEnum { ENDPOINT(0), + @Deprecated("Service cancellation is deprecated.") SERVICE(1), REQUEST(2), + @Deprecated("Cancellation acknowledgement is deprecated.") CANCELLATION_ACK(3), ; diff --git a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcConnector.kt b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcConnector.kt index ed1b0482..bf480822 100644 --- a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcConnector.kt +++ b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcConnector.kt @@ -5,16 +5,21 @@ package kotlinx.rpc.krpc.internal import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock import kotlinx.rpc.internal.utils.InternalRpcApi +import kotlinx.rpc.internal.utils.map.RpcInternalConcurrentHashMap import kotlinx.rpc.krpc.KrpcTransport import kotlinx.rpc.krpc.KrpcTransportMessage import kotlinx.rpc.krpc.internal.logging.RpcInternalCommonLogger import kotlinx.rpc.krpc.internal.logging.RpcInternalDumpLoggerContainer +import kotlinx.rpc.krpc.receiveCatching import kotlinx.serialization.* +import kotlin.time.Duration.Companion.seconds @InternalRpcApi public interface KrpcMessageSender : CoroutineScope { @@ -39,7 +44,7 @@ private typealias KrpcMessageHandler = suspend (KrpcMessage) -> Unit * DO NOT use actual dumper in production! */ @InternalRpcApi -public class KrpcConnector( +public class KrpcConnector( private val serialFormat: SerialFormat, private val transport: KrpcTransport, private val waitForSubscribers: Boolean = true, @@ -49,10 +54,9 @@ public class KrpcConnector( private val role = if (isServer) SERVER_ROLE else CLIENT_ROLE private val logger = RpcInternalCommonLogger.logger(rpcInternalObjectId(role)) - private val mutex = Mutex() - - private val waiting = mutableMapOf>() - private val subscriptions = mutableMapOf() + private val waiting = RpcInternalConcurrentHashMap>() + private val subscriptions = RpcInternalConcurrentHashMap() + private val processWaitersLocks = RpcInternalConcurrentHashMap() private val dumpLogger by lazy { RpcInternalDumpLoggerContainer.provide() } @@ -78,19 +82,23 @@ public class KrpcConnector( transport.send(transportMessage) } - public fun unsubscribeFromMessages(key: SubscriptionKey) { - launch { mutex.withLock { subscriptions.remove(key) } } + public fun unsubscribeFromMessages(key: SubscriptionKey, callback: () -> Unit = {}) { + launch(CoroutineName("krpc-connector-unsubscribe-$key")) { + delay(15.seconds) + subscriptions.remove(key) + processWaitersLocks.remove(key) + }.invokeOnCompletion { + callback() + } } public suspend fun subscribeToMessages(key: SubscriptionKey, handler: KrpcMessageHandler) { - mutex.withLock { - subscriptions[key] = handler - processWaiters(key, handler) - } + subscriptions[key] = handler + processWaiters(key, handler) } init { - launch { + launch(CoroutineName("krpc-connector-receive-loop")) { while (true) { processMessage(transport.receiveCatching().getOrNull() ?: break) } @@ -119,7 +127,7 @@ public class KrpcConnector( processMessage(message) } - private suspend fun processMessage(message: KrpcMessage) = mutex.withLock { + private suspend fun processMessage(message: KrpcMessage) = withLockForKey(message.getKey()) { when (message) { is KrpcCallMessage -> processServiceMessage(message) is KrpcProtocolMessage, is KrpcGenericMessage -> processNonServiceMessage(message) @@ -139,7 +147,7 @@ public class KrpcConnector( } HandlerResult.NoSubscription -> { - waiting.getOrPut(message.getKey()) { mutableListOf() }.add(message) + waiting.computeIfAbsent(message.getKey()) { mutableListOf() }.add(message) } HandlerResult.Success -> {} // ok @@ -152,7 +160,7 @@ public class KrpcConnector( // todo better exception processing probably if (result != HandlerResult.Success) { if (waitForSubscribers) { - waiting.getOrPut(message.getKey()) { mutableListOf() }.add(message) + waiting.computeIfAbsent(message.getKey()) { mutableListOf() }.add(message) val reason = when (result) { is HandlerResult.Failure -> { @@ -160,7 +168,7 @@ public class KrpcConnector( } is HandlerResult.NoSubscription -> { - "No service with key '${message.getKey()}' and '${message.serviceType}' type was registered." + + "No service with key '${message.getKey()}' and '${message.serviceType}' type was registered. " + "Available: keys: [${subscriptions.keys.joinToString()}]" } @@ -171,7 +179,7 @@ public class KrpcConnector( logger.warn((result as? HandlerResult.Failure)?.cause) { "No registered service of ${message.serviceType} service type " + - "was able to process message at the moment. Waiting for new services." + + "was able to process message ($message) at the moment. Waiting for new services. " + "Reason: $reason" } @@ -182,7 +190,7 @@ public class KrpcConnector( val cause = IllegalStateException( "Failed to process call ${message.callId} for service ${message.serviceType}, " + - "${subscriptions.size} attempts failed", + "${subscriptions.values.size} attempts failed", initialCause, ) @@ -225,18 +233,24 @@ public class KrpcConnector( } private suspend fun processWaiters(key: SubscriptionKey, handler: KrpcMessageHandler) { - if (waiting.isEmpty()) return + withLockForKey(key) { + if (waiting.values.isEmpty()) return - val iterator = waiting[key]?.iterator() ?: return - while (iterator.hasNext()) { - val message = iterator.next() + val iterator = waiting[key]?.iterator() ?: return + while (iterator.hasNext()) { + val message = iterator.next() - if (tryHandle(message, handler) == HandlerResult.Success) { - iterator.remove() + val tryHandle = tryHandle(message, handler) + if (tryHandle == HandlerResult.Success) { + iterator.remove() + } } } } + private suspend inline fun withLockForKey(key: SubscriptionKey, action: () -> T): T = + processWaitersLocks.computeIfAbsent(key) { Mutex() }.withLock(action = action) + internal companion object { const val SEND_PHASE = "Send" const val RECEIVE_PHASE = "Receive" diff --git a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcEndpoint.kt b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcEndpoint.kt index 88c8f107..3289f0a2 100644 --- a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcEndpoint.kt +++ b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcEndpoint.kt @@ -4,6 +4,7 @@ package kotlinx.rpc.krpc.internal +import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.cancel import kotlinx.coroutines.launch import kotlinx.rpc.internal.utils.InternalRpcApi @@ -30,7 +31,7 @@ public interface KrpcEndpoint { return } - val sendJob = sender.launch { + val sendJob = sender.launch(CoroutineName("krpc-endpoint-cancellation-$serviceId-$cancellationId")) { val message = KrpcGenericMessage( connectionId = null, pluginParams = listOfNotNull( diff --git a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcPlugin.kt b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcPlugin.kt index 6804eeb1..55243646 100644 --- a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcPlugin.kt +++ b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcPlugin.kt @@ -55,6 +55,11 @@ public enum class KrpcPlugin( * This feature adds support for proper service/request cancellation over the network. */ NON_SUSPENDING_SERVER_FLOWS(3, KrpcVersion.V_0_6_0), + + /** + * Clients don't require cancellation acknowledgement from the peer server. + */ + NO_ACK_CANCELLATION(4, KrpcVersion.V_0_8_0), ; @InternalRpcApi diff --git a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcVersion.kt b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcVersion.kt index 7b8a3009..fb310ec5 100644 --- a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcVersion.kt +++ b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcVersion.kt @@ -8,13 +8,7 @@ package kotlinx.rpc.krpc.internal * Release versions of the library */ internal enum class KrpcVersion { - /** - * Version 0.1.0 - */ V_0_1_0_BETA, - - /** - * Version 0.6.0 - */ V_0_6_0, + V_0_8_0, } diff --git a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/StreamSerializer.kt b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/StreamSerializer.kt index d15fa14f..0bdef9be 100644 --- a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/StreamSerializer.kt +++ b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/StreamSerializer.kt @@ -9,7 +9,7 @@ import kotlinx.serialization.descriptors.PrimitiveKind import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor import kotlinx.serialization.descriptors.SerialDescriptor -@Suppress("PropertyName") +@Suppress("PropertyName", "detekt.VariableNaming") @InternalRpcApi public abstract class StreamSerializer { protected val STREAM_ID_SERIAL_NAME: String = "streamId" diff --git a/krpc/krpc-ktor/krpc-ktor-client/api/krpc-ktor-client.api b/krpc/krpc-ktor/krpc-ktor-client/api/krpc-ktor-client.api index 64a0821c..2cc3957b 100644 --- a/krpc/krpc-ktor/krpc-ktor-client/api/krpc-ktor-client.api +++ b/krpc/krpc-ktor/krpc-ktor-client/api/krpc-ktor-client.api @@ -20,7 +20,3 @@ public abstract interface class kotlinx/rpc/krpc/ktor/client/KtorRpcClient : kot public abstract fun getWebSocketSession ()Lio/ktor/websocket/WebSocketSession; } -public final class kotlinx/rpc/krpc/ktor/client/KtorRpcClient$DefaultImpls { - public static fun callServerStreaming (Lkotlinx/rpc/krpc/ktor/client/KtorRpcClient;Lkotlinx/rpc/RpcCall;)Lkotlinx/coroutines/flow/Flow; -} - diff --git a/krpc/krpc-ktor/krpc-ktor-core/src/jvmTest/kotlin/kotlinx/rpc/krpc/ktor/KtorTransportTest.kt b/krpc/krpc-ktor/krpc-ktor-core/src/jvmTest/kotlin/kotlinx/rpc/krpc/ktor/KtorTransportTest.kt index b7584d98..0f4fff9e 100644 --- a/krpc/krpc-ktor/krpc-ktor-core/src/jvmTest/kotlin/kotlinx/rpc/krpc/ktor/KtorTransportTest.kt +++ b/krpc/krpc-ktor/krpc-ktor-core/src/jvmTest/kotlin/kotlinx/rpc/krpc/ktor/KtorTransportTest.kt @@ -9,7 +9,6 @@ package kotlinx.rpc.krpc.ktor import io.ktor.server.application.* import io.ktor.server.testing.* import kotlinx.coroutines.cancel -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc import kotlinx.rpc.krpc.ktor.client.installKrpc import kotlinx.rpc.krpc.ktor.client.rpc @@ -19,16 +18,14 @@ import kotlinx.rpc.krpc.ktor.server.rpc import kotlinx.rpc.krpc.serialization.json.json import kotlinx.rpc.withService import org.junit.Assert.assertEquals -import kotlin.coroutines.CoroutineContext import kotlin.test.Test @Rpc -interface NewService : RemoteService { +interface NewService { suspend fun echo(value: String): String } class NewServiceImpl( - override val coroutineContext: CoroutineContext, private val call: ApplicationCall, ) : NewService { @Suppress("UastIncorrectHttpHeaderInspection") @@ -54,7 +51,7 @@ class KtorTransportTest { waitForServices = true } - registerService { NewServiceImpl(it, call) } + registerService { NewServiceImpl(call) } } } @@ -77,7 +74,6 @@ class KtorTransportTest { assertEquals("Hello, world!", firstActual) - serviceWithGlobalConfig.cancel() clientWithGlobalConfig.cancel() val clientWithNoConfig = createClient { @@ -98,7 +94,6 @@ class KtorTransportTest { assertEquals("Hello, world!", secondActual) - serviceWithLocalConfig.cancel() clientWithNoConfig.cancel() } } diff --git a/krpc/krpc-ktor/krpc-ktor-server/api/krpc-ktor-server.api b/krpc/krpc-ktor/krpc-ktor-server/api/krpc-ktor-server.api index 7ed6450b..cea1ea82 100644 --- a/krpc/krpc-ktor/krpc-ktor-server/api/krpc-ktor-server.api +++ b/krpc/krpc-ktor/krpc-ktor-server/api/krpc-ktor-server.api @@ -16,7 +16,7 @@ public final class kotlinx/rpc/krpc/ktor/server/KrpcRoute : io/ktor/server/webso public fun getOutgoing ()Lkotlinx/coroutines/channels/SendChannel; public fun getPingIntervalMillis ()J public fun getTimeoutMillis ()J - public final fun registerService (Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function1;)V + public final fun registerService (Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function0;)V public final fun rpcConfig (Lkotlin/jvm/functions/Function1;)V public fun send (Lio/ktor/websocket/Frame;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun setMasking (Z)V diff --git a/krpc/krpc-ktor/krpc-ktor-server/src/commonMain/kotlin/kotlinx/rpc/krpc/ktor/server/KrpcRoute.kt b/krpc/krpc-ktor/krpc-ktor-server/src/commonMain/kotlin/kotlinx/rpc/krpc/ktor/server/KrpcRoute.kt index efff16c5..857df76f 100644 --- a/krpc/krpc-ktor/krpc-ktor-server/src/commonMain/kotlin/kotlinx/rpc/krpc/ktor/server/KrpcRoute.kt +++ b/krpc/krpc-ktor/krpc-ktor-server/src/commonMain/kotlin/kotlinx/rpc/krpc/ktor/server/KrpcRoute.kt @@ -8,7 +8,6 @@ import io.ktor.server.websocket.* import kotlinx.rpc.RpcServer import kotlinx.rpc.annotations.Rpc import kotlinx.rpc.krpc.KrpcConfigBuilder -import kotlin.coroutines.CoroutineContext import kotlin.reflect.KClass @Deprecated("Use KrpcRoute instead", ReplaceWith("KrpcRoute"), level = DeprecationLevel.ERROR) @@ -47,7 +46,7 @@ public class KrpcRoute( */ public fun <@Rpc Service : Any> registerService( serviceKClass: KClass, - serviceFactory: (CoroutineContext) -> Service, + serviceFactory: () -> Service, ) { registrations.add { server -> server.registerService(serviceKClass, serviceFactory) @@ -64,7 +63,7 @@ public class KrpcRoute( * @param serviceFactory function that produces the actual implementation of the service that will handle the calls. */ public inline fun <@Rpc reified Service : Any> registerService( - noinline serviceFactory: (CoroutineContext) -> Service, + noinline serviceFactory: () -> Service, ) { registerService(Service::class, serviceFactory) } diff --git a/krpc/krpc-ktor/krpc-ktor-server/src/commonMain/kotlin/kotlinx/rpc/krpc/ktor/server/KtorServerDsl.kt b/krpc/krpc-ktor/krpc-ktor-server/src/commonMain/kotlin/kotlinx/rpc/krpc/ktor/server/KtorServerDsl.kt index 927e61a6..ae4e5e57 100644 --- a/krpc/krpc-ktor/krpc-ktor-server/src/commonMain/kotlin/kotlinx/rpc/krpc/ktor/server/KtorServerDsl.kt +++ b/krpc/krpc-ktor/krpc-ktor-server/src/commonMain/kotlin/kotlinx/rpc/krpc/ktor/server/KtorServerDsl.kt @@ -54,6 +54,6 @@ private fun Route.createRpcServer(rpcRouteBuilder: KrpcRoute.() -> Unit) { registration(server) } - server.coroutineContext.job.join() + server.internalScope.coroutineContext.job.join() } } diff --git a/krpc/krpc-server/api/krpc-server.api b/krpc/krpc-server/api/krpc-server.api index 41b38da4..2a621460 100644 --- a/krpc/krpc-server/api/krpc-server.api +++ b/krpc/krpc-server/api/krpc-server.api @@ -1,6 +1,6 @@ public abstract class kotlinx/rpc/krpc/server/KrpcServer : kotlinx/rpc/RpcServer, kotlinx/rpc/krpc/internal/KrpcEndpoint { public fun (Lkotlinx/rpc/krpc/KrpcConfig$Server;Lkotlinx/rpc/krpc/KrpcTransport;)V - public final fun getCoroutineContext ()Lkotlin/coroutines/CoroutineContext; - public final fun registerService (Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function1;)V + public fun deregisterService (Lkotlin/reflect/KClass;)V + public final fun registerService (Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function0;)V } diff --git a/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/KrpcServer.kt b/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/KrpcServer.kt index 8782071d..a4cad98a 100644 --- a/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/KrpcServer.kt +++ b/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/KrpcServer.kt @@ -17,7 +17,7 @@ import kotlinx.rpc.krpc.internal.* import kotlinx.rpc.krpc.internal.logging.RpcInternalCommonLogger import kotlinx.rpc.krpc.server.internal.KrpcServerConnector import kotlinx.rpc.krpc.server.internal.KrpcServerService -import kotlin.coroutines.CoroutineContext +import kotlin.concurrent.Volatile import kotlin.reflect.KClass @Deprecated("Use KrpcServer instead", ReplaceWith("KrpcServer"), level = DeprecationLevel.ERROR) @@ -46,8 +46,8 @@ public abstract class KrpcServer( private val config: KrpcConfig.Server, transport: KrpcTransport, ) : RpcServer, KrpcEndpoint { - // we make a child here, so we can send cancellation messages before closing the connection - final override val coroutineContext: CoroutineContext = SupervisorJob(transport.coroutineContext.job) + @InternalRpcApi + public val internalScope: CoroutineScope = CoroutineScope(SupervisorJob(transport.coroutineContext.job)) private val logger = RpcInternalCommonLogger.logger(rpcInternalObjectId()) @@ -66,21 +66,19 @@ public abstract class KrpcServer( final override var supportedPlugins: Set = emptySet() private set - private val rpcServices = RpcInternalConcurrentHashMap>() - - // compatibility with clients that do not have serviceId - private var nullRpcServices = RpcInternalConcurrentHashMap>() + private val rpcServices = RpcInternalConcurrentHashMap>() + @Volatile private var cancelledByClient = false init { - coroutineContext.job.invokeOnCompletion(onCancelling = true) { + internalScope.coroutineContext.job.invokeOnCompletion(onCancelling = true) { if (!cancelledByClient) { sendCancellation(CancellationType.ENDPOINT, null, null, closeTransportAfterSending = true) } } - launch { + internalScope.launch(CoroutineName("krpc-server-generic-protocol-messages")) { connector.subscribeToProtocolMessages(::handleProtocolMessage) connector.subscribeToGenericMessages(::handleGenericMessage) @@ -105,20 +103,14 @@ public abstract class KrpcServer( final override fun <@Rpc Service : Any> registerService( serviceKClass: KClass, - serviceFactory: (CoroutineContext) -> Service, + serviceFactory: () -> Service, ) { val descriptor = serviceDescriptorOf(serviceKClass) - launch { + internalScope.launch(CoroutineName("krpc-server-service-$descriptor")) { connector.subscribeToServiceMessages(descriptor.fqName) { message -> - val rpcServerService = when (val id = message.serviceId) { - null -> nullRpcServices.computeIfAbsent(descriptor.fqName) { - createNewServiceInstance(descriptor, serviceFactory) - } - - else -> rpcServices.computeIfAbsent(id) { - createNewServiceInstance(descriptor, serviceFactory) - } + val rpcServerService = rpcServices.computeIfAbsent(descriptor.fqName) { + createNewServiceInstance(descriptor, serviceFactory) } rpcServerService.accept(message) @@ -126,23 +118,22 @@ public abstract class KrpcServer( } } + override fun <@Rpc Service : Any> deregisterService(serviceKClass: KClass) { + connector.unsubscribeFromServiceMessages(serviceDescriptorOf(serviceKClass).fqName) + } + private fun <@Rpc Service : Any> createNewServiceInstance( descriptor: RpcServiceDescriptor, - serviceFactory: (CoroutineContext) -> Service, + serviceFactory: () -> Service, ): KrpcServerService { - val serviceInstanceContext = SupervisorJob(coroutineContext.job) - return KrpcServerService( - service = serviceFactory(serviceInstanceContext), + service = serviceFactory(), descriptor = descriptor, config = config, connector = connector, - coroutineContext = serviceInstanceContext, - ).apply { - coroutineContext.job.invokeOnCompletion { - connector.unsubscribeFromServiceMessages(descriptor.fqName) - } - } + supportedPlugins = supportedPlugins, + serverScope = internalScope, + ) } @InternalRpcApi @@ -151,25 +142,18 @@ public abstract class KrpcServer( CancellationType.ENDPOINT -> { cancelledByClient = true - cancel("Server cancelled by client") + internalScope.cancel("Server cancelled by client") rpcServices.clear() } - CancellationType.SERVICE -> { - val serviceId = message[KrpcPluginKey.CLIENT_SERVICE_ID]?.toLongOrNull() - ?: error("Expected CLIENT_SERVICE_ID for cancellation of type 'service' as Long value") - - rpcServices[serviceId]?.cancel("Service cancelled by client") - } - CancellationType.REQUEST -> { - val serviceId = message[KrpcPluginKey.CLIENT_SERVICE_ID]?.toLongOrNull() - ?: error("Expected CLIENT_SERVICE_ID for cancellation of type 'request' as Long value") + val serviceType = message[KrpcPluginKey.CLIENT_SERVICE_ID] + ?: error("Expected CLIENT_SERVICE_ID for cancellation of type 'request'") val callId = message[KrpcPluginKey.CANCELLATION_ID] ?: error("Expected CANCELLATION_ID for cancellation of type 'request'") - rpcServices[serviceId]?.cancelRequest(callId, "Request cancelled by client") + rpcServices[serviceType]?.cancelRequestWithOptionalAck(callId, "Request cancelled by client") } else -> { diff --git a/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/KrpcServerConnector.kt b/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/KrpcServerConnector.kt index 804c9d24..88644124 100644 --- a/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/KrpcServerConnector.kt +++ b/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/KrpcServerConnector.kt @@ -33,8 +33,8 @@ internal class KrpcServerConnector private constructor( } ) - fun unsubscribeFromServiceMessages(serviceTypeString: String) { - connector.unsubscribeFromMessages(MessageKey.Service(serviceTypeString)) + fun unsubscribeFromServiceMessages(serviceTypeString: String, callback: () -> Unit = {}) { + connector.unsubscribeFromMessages(MessageKey.Service(serviceTypeString), callback) } suspend fun subscribeToServiceMessages( diff --git a/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/KrpcServerService.kt b/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/KrpcServerService.kt index 49693826..9ab5afba 100644 --- a/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/KrpcServerService.kt +++ b/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/KrpcServerService.kt @@ -18,7 +18,6 @@ import kotlinx.serialization.KSerializer import kotlinx.serialization.SerialFormat import kotlinx.serialization.StringFormat import kotlinx.serialization.modules.SerializersModule -import kotlin.coroutines.CoroutineContext import kotlin.reflect.typeOf internal class KrpcServerService<@Rpc T : Any>( @@ -26,18 +25,13 @@ internal class KrpcServerService<@Rpc T : Any>( private val descriptor: RpcServiceDescriptor, private val config: KrpcConfig.Server, private val connector: KrpcServerConnector, - override val coroutineContext: CoroutineContext, -) : CoroutineScope { + private val serverScope: CoroutineScope, + private val supportedPlugins: Set, +) { private val logger = RpcInternalCommonLogger.logger(rpcInternalObjectId(descriptor.fqName)) private val requestMap = RpcInternalConcurrentHashMap() - init { - coroutineContext.job.invokeOnCompletion { - logger.trace { "Service completed with $it" } - } - } - suspend fun accept(message: KrpcCallMessage) { val result = runCatching { processMessage(message) @@ -138,7 +132,7 @@ internal class KrpcServerService<@Rpc T : Any>( var failure: Throwable? = null - val requestJob = launch(start = CoroutineStart.LAZY) { + val requestJob = serverScope.launch(start = CoroutineStart.LAZY) { try { val markedNonSuspending = callData.pluginParams.orEmpty() .contains(KrpcPluginKey.NON_SUSPENDING_SERVER_FLOW_MARKER) @@ -322,20 +316,28 @@ internal class KrpcServerService<@Rpc T : Any>( cause: Throwable? = null, fromJob: Boolean = false, ) { - serverStreamContext.removeCall(callId, cause) requestMap.remove(callId)?.cancelAndClose(callId, message, cause, fromJob) + } + + suspend fun cancelRequestWithOptionalAck( + callId: String, + message: String? = null, + cause: Throwable? = null, + ) { + cancelRequest(callId, message, cause, fromJob = false) - // acknowledge the cancellation - connector.sendMessage( - KrpcGenericMessage( - connectionId = null, - pluginParams = mapOf( - KrpcPluginKey.GENERIC_MESSAGE_TYPE to KrpcGenericMessage.CANCELLATION_TYPE, - KrpcPluginKey.CANCELLATION_TYPE to CancellationType.CANCELLATION_ACK.toString(), - KrpcPluginKey.CANCELLATION_ID to callId, + if (!supportedPlugins.contains(KrpcPlugin.NO_ACK_CANCELLATION)) { + connector.sendMessage( + KrpcGenericMessage( + connectionId = null, + pluginParams = mapOf( + KrpcPluginKey.GENERIC_MESSAGE_TYPE to KrpcGenericMessage.CANCELLATION_TYPE, + KrpcPluginKey.CANCELLATION_TYPE to CancellationType.CANCELLATION_ACK.toString(), + KrpcPluginKey.CANCELLATION_ID to callId, + ) ) ) - ) + } } private val serverStreamContext: ServerStreamContext = ServerStreamContext() diff --git a/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/ServerStreamContext.kt b/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/ServerStreamContext.kt index fd906690..8e2f01b7 100644 --- a/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/ServerStreamContext.kt +++ b/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/ServerStreamContext.kt @@ -8,23 +8,22 @@ import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow import kotlinx.rpc.internal.utils.map.RpcInternalConcurrentHashMap +import kotlinx.rpc.internal.utils.thread.RpcInternalThreadLocal import kotlinx.rpc.krpc.internal.KrpcCallMessage import kotlinx.rpc.krpc.internal.decodeMessageData import kotlinx.rpc.krpc.internal.deserialize import kotlinx.serialization.KSerializer import kotlinx.serialization.SerialFormat -import kotlin.native.concurrent.ThreadLocal internal class ServerStreamContext { - @ThreadLocal - private var currentCallId: String? = null + private val currentCallId = RpcInternalThreadLocal() fun scoped(callId: String, body: () -> T): T { try { - currentCallId = callId + currentCallId.set(callId) return body() } finally { - currentCallId = null + currentCallId.remove() } } @@ -53,7 +52,7 @@ internal class ServerStreamContext { } fun prepareClientStream(streamId: String, elementKind: KSerializer): Flow { - val callId = currentCallId ?: error("No call id") + val callId = currentCallId.get() ?: error("No call id") val channel = Channel(Channel.UNLIMITED) @@ -68,7 +67,6 @@ internal class ServerStreamContext { val flow = flow { for (message in channel) { - println("Consumed on server: $message") when (message) { is StreamCancel -> { onClose() diff --git a/krpc/krpc-test/build.gradle.kts b/krpc/krpc-test/build.gradle.kts index c5160f95..ba1b5a81 100644 --- a/krpc/krpc-test/build.gradle.kts +++ b/krpc/krpc-test/build.gradle.kts @@ -30,8 +30,6 @@ kotlin { api(projects.krpc.krpcClient) api(projects.krpc.krpcLogging) - implementation(libs.coroutines.debug) - implementation(projects.krpc.krpcSerialization.krpcSerializationJson) implementation(libs.serialization.core) @@ -42,6 +40,7 @@ kotlin { jvmMain { dependencies { + implementation(libs.coroutines.debug) implementation(libs.kotlin.test.junit) } } diff --git a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestService.kt b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestService.kt index 3babc86b..45aca603 100644 --- a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestService.kt +++ b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestService.kt @@ -5,7 +5,6 @@ package kotlinx.rpc.krpc.test import kotlinx.coroutines.flow.Flow -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc import kotlinx.serialization.Contextual import kotlinx.serialization.Serializable @@ -43,7 +42,7 @@ data class LocalDateTime( @Suppress("detekt.TooManyFunctions") @Rpc -interface KrpcTestService : RemoteService { +interface KrpcTestService { fun nonSuspendFlow(): Flow fun nonSuspendFlowErrorOnEmit(): Flow fun nonSuspendFlowErrorOnReturn(): Flow diff --git a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.kt b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.kt index 195cac0e..2ec18fb8 100644 --- a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.kt +++ b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.kt @@ -6,14 +6,14 @@ package kotlinx.rpc.krpc.test import kotlinx.coroutines.* import kotlinx.coroutines.flow.* +import kotlinx.coroutines.test.TestScope import kotlinx.serialization.Serializable -import kotlin.coroutines.CoroutineContext import kotlin.coroutines.resumeWithException import kotlin.test.assertContentEquals import kotlin.test.assertEquals @OptIn(ExperimentalCoroutinesApi::class) -class KrpcTestServiceBackend(override val coroutineContext: CoroutineContext) : KrpcTestService { +class KrpcTestServiceBackend : KrpcTestService { override fun nonSuspendFlow(): Flow { return flow { repeat(10) { @@ -235,4 +235,4 @@ class KrpcTestServiceBackend(override val coroutineContext: CoroutineContext) : internal expect fun runThreadIfPossible(runner: () -> Unit) -internal expect fun CoroutineScope.debugCoroutines() +internal expect fun TestScope.debugCoroutines() diff --git a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTransportTestBase.kt b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTransportTestBase.kt index a9481987..fb69e9a3 100644 --- a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTransportTestBase.kt +++ b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTransportTestBase.kt @@ -92,8 +92,8 @@ abstract class KrpcTransportTestBase { @BeforeTest fun start() { backend = KrpcTestServer(serverConfig, serverTransport) - backend.registerService { ctx -> - KrpcTestServiceBackend(ctx).also { + backend.registerService { + KrpcTestServiceBackend().also { server = it } } @@ -101,11 +101,6 @@ abstract class KrpcTransportTestBase { client = KrpcTestClient(clientConfig, clientTransport).withService() } - @AfterTest - fun end() { - backend.cancel() - } - @Test fun nonSuspend() = runTest { assertEquals(List(10) { it }, client.nonSuspendFlow().toList()) @@ -142,12 +137,6 @@ abstract class KrpcTransportTestBase { ) } - @Test - fun empty() { - backend.cancel() - client.cancel() - } - @Test fun returnType() = runTest { assertEquals("test", client.returnType()) diff --git a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/Payloads.kt b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/Payloads.kt index 7a077316..49bacea5 100644 --- a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/Payloads.kt +++ b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/Payloads.kt @@ -1,3 +1,5 @@ +@file:Suppress("detekt.MatchingDeclarationName") + /* * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ diff --git a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/ProtocolTestBase.kt b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/ProtocolTestBase.kt index 2ca024a4..9f83fcbc 100644 --- a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/ProtocolTestBase.kt +++ b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/ProtocolTestBase.kt @@ -9,7 +9,6 @@ import kotlinx.coroutines.cancelAndJoin import kotlinx.coroutines.job import kotlinx.coroutines.test.TestResult import kotlinx.coroutines.test.TestScope -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc import kotlinx.rpc.internal.utils.hex.rpcInternalHexToReadableBinary import kotlinx.rpc.krpc.KrpcConfig @@ -24,7 +23,6 @@ import kotlinx.rpc.krpc.server.KrpcServer import kotlinx.rpc.registerService import kotlinx.rpc.withService import kotlinx.serialization.BinaryFormat -import kotlin.coroutines.CoroutineContext abstract class ProtocolTestBase { protected fun runTest( @@ -80,9 +78,7 @@ abstract class ProtocolTestBase { val defaultServer by lazy { ProtocolTestServer(serverConfig, transport).apply { - registerService { - ProtocolTestServiceImpl(transport.coroutineContext) - } + registerService { ProtocolTestServiceImpl() } } } @@ -91,13 +87,11 @@ abstract class ProtocolTestBase { } @Rpc -interface ProtocolTestService : RemoteService { +interface ProtocolTestService { suspend fun sendRequest() } -private class ProtocolTestServiceImpl( - override val coroutineContext: CoroutineContext, -) : ProtocolTestService { +private class ProtocolTestServiceImpl : ProtocolTestService { override suspend fun sendRequest() { // nothing } diff --git a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/SamplingService.kt b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/SamplingService.kt index 36e9f9ff..04b74ebc 100644 --- a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/SamplingService.kt +++ b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/SamplingService.kt @@ -7,11 +7,9 @@ package org.jetbrains.krpc.test.api.util import kotlinx.coroutines.flow.* -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc import kotlinx.rpc.krpc.test.plainFlow import kotlinx.serialization.Serializable -import kotlin.coroutines.CoroutineContext @Serializable data class SamplingData( @@ -19,7 +17,7 @@ data class SamplingData( ) @Rpc -interface SamplingService : RemoteService { +interface SamplingService { suspend fun echo(arg1: String, data: SamplingData): SamplingData suspend fun clientStream(flow: Flow): List @@ -29,7 +27,7 @@ interface SamplingService : RemoteService { suspend fun callException() } -class SamplingServiceImpl(override val coroutineContext: CoroutineContext) : SamplingService { +class SamplingServiceImpl : SamplingService { override suspend fun echo(arg1: String, data: SamplingData): SamplingData { return data } diff --git a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/TransportTest.kt b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/TransportTest.kt index e1c2e17f..88ab602b 100644 --- a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/TransportTest.kt +++ b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/TransportTest.kt @@ -17,24 +17,23 @@ import kotlinx.rpc.krpc.internal.logging.RpcInternalDumpLoggerContainer import kotlinx.rpc.krpc.rpcClientConfig import kotlinx.rpc.krpc.rpcServerConfig import kotlinx.rpc.krpc.serialization.json.json -import kotlin.coroutines.CoroutineContext -import kotlin.test.Ignore import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFails import kotlin.test.assertTrue +import kotlin.time.Duration.Companion.seconds @Rpc -interface Echo : RemoteService { +interface Echo { suspend fun echo(message: String): String } @Rpc -interface Second : RemoteService { +interface Second { suspend fun second(message: String): String } -class EchoImpl(override val coroutineContext: CoroutineContext) : Echo { +class EchoImpl : Echo { val received = atomic(0) override suspend fun echo(message: String): String { @@ -43,7 +42,7 @@ class EchoImpl(override val coroutineContext: CoroutineContext) : Echo { } } -class SecondServer(override val coroutineContext: CoroutineContext) : Second { +class SecondServer : Second { val received = atomic(0) override suspend fun second(message: String): String { @@ -71,27 +70,30 @@ class TransportTest { private fun serverOf( localTransport: LocalTransport, - config: (KrpcConfigBuilder.Server.() -> Unit)? = null + config: (KrpcConfigBuilder.Server.() -> Unit)? = null, ): RpcServer { val serverConfig = config?.let { rpcServerConfig(it) } ?: serverConfig return KrpcTestServer(serverConfig, localTransport.server) } - private fun runTest(block: suspend TestScope.() -> Unit): TestResult = kotlinx.coroutines.test.runTest { - val logger = RpcInternalCommonLogger.logger("TransportTest") + private fun runTest(block: suspend TestScope.() -> Unit): TestResult = + kotlinx.coroutines.test.runTest(timeout = 15.seconds) { + debugCoroutines() - RpcInternalDumpLoggerContainer.set(object : RpcInternalDumpLogger { - override val isEnabled: Boolean = true + val logger = RpcInternalCommonLogger.logger("TransportTest") - override fun dump(vararg tags: String, message: () -> String) { - logger.info { "${tags.joinToString(" ") { "[$it]" }} ${message()}" } - } - }) + RpcInternalDumpLoggerContainer.set(object : RpcInternalDumpLogger { + override val isEnabled: Boolean = true - block() + override fun dump(vararg tags: String, message: () -> String) { + logger.info { "${tags.joinToString(" ") { "[$it]" }} ${message()}" } + } + }) - RpcInternalDumpLoggerContainer.set(null) - } + block() + + RpcInternalDumpLoggerContainer.set(null) + } @Test fun testUsingWrongService() = runTest { @@ -111,10 +113,10 @@ class TransportTest { waitForServices = false } - server.registerService { EchoImpl(it) } + server.registerService { EchoImpl() } result.await() - server.cancel() + transports.cancel() } @Test @@ -128,12 +130,12 @@ class TransportTest { val server = serverOf(transports) - val echoServices = server.registerServiceAndReturn { EchoImpl(it) } + val echoServices = server.registerServiceAndReturn { EchoImpl() } assertEquals("foo", result.await()) assertEquals(1, echoServices.single().received.value) - server.cancel() + transports.cancel() } @Test @@ -148,41 +150,38 @@ class TransportTest { } val server = serverOf(transports) - val echoServices = server.registerServiceAndReturn { EchoImpl(it) } + val echoServices = server.registerServiceAndReturn { EchoImpl() } val response = result.awaitAll() assertTrue { response.all { it == "foo" } } assertEquals(10, echoServices.single().received.value) - server.cancel() + transports.cancel() } @Test fun testLateConnectWithManyServices() = runTest { - repeat(100) { - val transports = LocalTransport() + val transports = LocalTransport() - val client = clientOf(transports) + val client = clientOf(transports) - val result = List(10) { - async { - val service = client.withService() - service.echo("foo") - } + val result = List(3) { + async { + val service = client.withService() + service.echo("foo") } + } - val server = serverOf(transports) - val echoServices = server.registerServiceAndReturn { EchoImpl(it) } + val server = serverOf(transports) + val echoServices = server.registerServiceAndReturn { EchoImpl() } - val response = result.awaitAll() - assertTrue { response.all { it == "foo" } } - assertEquals(10, echoServices.sumOf { it.received.value }) + val response = result.awaitAll() + assertTrue { response.all { it == "foo" } } + assertEquals(3, echoServices.sumOf { it.received.value }) - server.cancel() - } + transports.coroutineContext.job.cancelAndJoin() } - @Test fun testLateConnectWithManyCallsAndClients() = runTest { val transports = LocalTransport() @@ -201,13 +200,13 @@ class TransportTest { } val server = serverOf(transports) - val echoServices = server.registerServiceAndReturn { EchoImpl(it) } + val echoServices = server.registerServiceAndReturn { EchoImpl() } val response = result.awaitAll().flatten() assertTrue { response.all { it == "foo" } } assertEquals(100, echoServices.sumOf { it.received.value }) - server.cancel() + transports.cancel() } @Test @@ -229,43 +228,24 @@ class TransportTest { val server = serverOf(transports) delay(1000) - val echoServices = server.registerServiceAndReturn { EchoImpl(it) } + val echoServices = server.registerServiceAndReturn { EchoImpl() } assertEquals("foo", firstResult.await()) assertEquals(1, echoServices.single().received.value) - echoServices.single().cancel() delay(1000) - val secondServices = server.registerServiceAndReturn { SecondServer(it) } + val secondServices = server.registerServiceAndReturn { SecondServer() } assertEquals("bar", secondResult.await()) assertEquals(1, secondServices.single().received.value) - secondServices.single().cancel() - server.cancel() - } - - @Test - @Ignore - fun testCancelFromClientToServer() = runTest { - val transports = LocalTransport() - - val client = clientOf(transports).withService() - - val server = serverOf(transports) - val echoServices = server.registerServiceAndReturn { EchoImpl(it) } - - client.cancel() - echoServices.single().coroutineContext.job.join() - assertTrue(echoServices.single().coroutineContext.job.isCancelled) + transports.cancel() } private inline fun <@Rpc reified Service : Any, reified Impl : Service> RpcServer.registerServiceAndReturn( - crossinline body: (CoroutineContext) -> Impl, + crossinline body: () -> Impl, ): List { val instances = mutableListOf() - registerService { ctx -> - body(ctx).also { instances.add(it) } - } + registerService { body().also { instances.add(it) } } return instances } diff --git a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationService.kt b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationService.kt index a44d3f16..d266e211 100644 --- a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationService.kt +++ b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationService.kt @@ -7,12 +7,10 @@ package kotlinx.rpc.krpc.test.cancellation import kotlinx.atomicfu.atomic import kotlinx.coroutines.* import kotlinx.coroutines.flow.* -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc -import kotlin.coroutines.CoroutineContext @Rpc -interface CancellationService : RemoteService { +interface CancellationService { suspend fun longRequest() suspend fun serverDelay(millis: Long) @@ -30,7 +28,7 @@ interface CancellationService : RemoteService { fun nonSuspendable(): Flow } -class CancellationServiceImpl(override val coroutineContext: CoroutineContext) : CancellationService { +class CancellationServiceImpl : CancellationService { val delayCounter = atomic(0) val consumedIncomingValues = mutableListOf() val firstIncomingConsumed = CompletableDeferred() @@ -74,18 +72,16 @@ class CancellationServiceImpl(override val coroutineContext: CoroutineContext) : error("exception in request") } - private fun consume(stream: Flow) { - launch { - try { - stream.collect { - if (!firstIncomingConsumed.isCompleted) { - firstIncomingConsumed.complete(it) - } - consumedIncomingValues.add(it) + private suspend fun consume(stream: Flow) { + try { + stream.collect { + if (!firstIncomingConsumed.isCompleted) { + firstIncomingConsumed.complete(it) } - } finally { - consumedAll.complete(Unit) + consumedIncomingValues.add(it) } + } finally { + consumedAll.complete(Unit) } } diff --git a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationTest.kt b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationTest.kt index 53372c73..10c9d9dc 100644 --- a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationTest.kt +++ b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationTest.kt @@ -5,7 +5,10 @@ package kotlinx.rpc.krpc.test.cancellation import kotlinx.coroutines.* +import kotlinx.coroutines.flow.catch import kotlinx.coroutines.flow.first +import kotlinx.coroutines.flow.flow +import kotlinx.coroutines.flow.mapNotNull import kotlinx.coroutines.flow.toList import kotlinx.rpc.withService import kotlin.test.* @@ -32,31 +35,6 @@ class CancellationTest { stopAllAndJoin() } - @Test - fun testCancelServiceScope() = runCancellationTest { - val firstRequestJob = launch { - service.serverDelay(300) - } - - val secondRequestJob = launch { - service.serverDelay(300) - } - - unskippableDelay(150) // wait for requests to reach server - service.cancel() - firstRequestJob.join() - secondRequestJob.join() - - assertTrue(firstRequestJob.isCancelled, "Expected firstRequestJob to be cancelled") - assertTrue(secondRequestJob.isCancelled, "Expected secondRequestJob to be cancelled") - - assertEquals(0, serverInstances.single().delayCounter.value, "Expected both requests to be cancelled") - - checkAlive(serviceAlive = false) - checkAlive(expectAlive = false, serverInstances.single().join(), "server instance") - stopAllAndJoin() - } - @Test fun testCallException() = runCancellationTest { val requestJob = launch { @@ -85,35 +63,6 @@ class CancellationTest { stopAllAndJoin() } - @Test - fun testCancelServiceWithOtherService() = runCancellationTest { - val firstRequestJob = launch { - service.serverDelay(300) - } - - val secondService = client.withService() - - val secondRequestJob = launch { - secondService.serverDelay(300) - } - - unskippableDelay(150) // wait for requests to reach server - secondService.cancel() - firstRequestJob.join() - secondRequestJob.join() - - assertFalse(firstRequestJob.isCancelled, "Expected firstRequestJob not to be cancelled") - assertTrue(secondRequestJob.isCancelled, "Expected secondRequestJob to be cancelled") - - assertEquals(2, serverInstances.size, "Expected two service instances on a server") - assertEquals(1, serverInstances.sumOf { it.delayCounter.value }, "Expected one request to succeed") - - val secondServiceInstance = serverInstances.single { it.delayCounter.value == 0 }.join() - checkAlive(expectAlive = false, secondServiceInstance, "server instance") - checkAlive() - stopAllAndJoin() - } - @Test fun testCancelClient() = runCancellationTest { val firstRequestJob = launch { @@ -127,7 +76,7 @@ class CancellationTest { } unskippableDelay(150) // wait for requests to reach server - client.cancel() + client.internalScope.cancel() firstRequestJob.join() secondRequestJob.join() @@ -136,14 +85,10 @@ class CancellationTest { assertEquals(0, serverInstances.sumOf { it.delayCounter.value }, "Expected no requests to succeed") - client.join() - server.join() + client.internalScope.join() + server.internalScope.join() - checkAlive(serviceAlive = false, clientAlive = false, serverAlive = false) - checkAlive(expectAlive = false, secondService, "second service") - serverInstances.forEachIndexed { i, impl -> - checkAlive(expectAlive = false, impl.join(), "server instance $i") - } + checkAlive(clientAlive = false, serverAlive = false) stopAllAndJoin() } @@ -160,7 +105,7 @@ class CancellationTest { } unskippableDelay(150) // wait for requests to reach server - server.cancel() + server.internalScope.cancel() firstRequestJob.join() secondRequestJob.join() @@ -169,98 +114,50 @@ class CancellationTest { assertEquals(0, serverInstances.sumOf { it.delayCounter.value }, "Expected no requests to succeed") - client.join() - server.join() + client.internalScope.join() + server.internalScope.join() - checkAlive(serviceAlive = false, clientAlive = false, serverAlive = false) - checkAlive(expectAlive = false, secondService, "second service") - serverInstances.forEachIndexed { i, impl -> - checkAlive(expectAlive = false, impl.join(), "server instance $i") - } + checkAlive(clientAlive = false, serverAlive = false) stopAllAndJoin() } @Test fun testStreamScopeOutgoing() = runCancellationTest { - val fence = CompletableDeferred() - - service.outgoingStream(resumableFlow(fence)) - serverInstance().firstIncomingConsumed.await() + service.outgoingStream( + flow { + repeat(2) { + emit(it) + + if (it == 0) { + serverInstance().firstIncomingConsumed.await() + } + } + } + ) - fence.complete(Unit) serverInstance().consumedAll.await() - assertContentEquals(listOf(0), serverInstance().consumedIncomingValues) + assertContentEquals(listOf(0, 1), serverInstance().consumedIncomingValues) stopAllAndJoin() } @Test fun testStreamScopeIncoming() = runCancellationTest { - val first: Int - val flow = service.incomingStream().apply { first = first() } - - serverInstance().fence.complete(Unit) - val consumed = flow.toList() - - assertEquals(0, first) - assertContentEquals(emptyList(), consumed) - - stopAllAndJoin() - } - - @Test - fun testExceptionInStreamScope() = runCancellationTest { - val fence = CompletableDeferred() - - runCatching { - service.outgoingStream(resumableFlow(fence)) - serverInstance().firstIncomingConsumed.await() - error("exception in stream scope") - } - - fence.complete(Unit) - - serverInstance().consumedAll.await() - assertContentEquals(listOf(0), serverInstance().consumedIncomingValues) - - stopAllAndJoin() - } - - @Test - fun testExceptionInRequest() = runCancellationTest { - val fence = CompletableDeferred() - - runCatching { - service.outgoingStreamWithException(resumableFlow(fence)) - } - - // to be sure that exception canceled the stream and not scope closure - serverInstance().consumedAll.await() - - assertContentEquals(listOf(0), serverInstance().consumedIncomingValues) - - stopAllAndJoin() - } - - @Test - fun testExceptionInRequestDoesNotCancelOtherRequests() = runCancellationTest { - val fence = CompletableDeferred() - + var first: Int = -1 val flow = service.incomingStream() - runCatching { - service.outgoingStreamWithException(resumableFlow(fence)) - } - - fence.complete(Unit) - serverInstance().fence.complete(Unit) - - val result = flow.toList() - - serverInstance().consumedAll.await() - assertContentEquals(listOf(0), serverInstance().consumedIncomingValues) + val consumed = flow.mapNotNull { + if (it == 0) { + first = it + serverInstance().fence.complete(Unit) + null + } else { + it + } + }.toList() - assertContentEquals(List(2) { it }, result) + assertEquals(0, first) + assertContentEquals(listOf(1), consumed) stopAllAndJoin() } @@ -315,7 +212,7 @@ class CancellationTest { } @Test - fun testServiceCancellationCancelsStream() = runCancellationTest { + fun testClientCancellationCancelsStream() = runCancellationTest { val fence = CompletableDeferred() launch { service.outgoingStream(resumableFlow(fence)) @@ -323,8 +220,8 @@ class CancellationTest { serverInstance().firstIncomingConsumed.await() - service.cancel("Test request cancelled") - service.join() + client.internalScope.cancel("Test request cancelled") + client.internalScope.join() serverInstance().consumedAll.await() @@ -333,70 +230,22 @@ class CancellationTest { stopAllAndJoin() } - @Test - fun testServiceCancellationCancelsStreamButNotOthers() = runCancellationTest { - val fence = CompletableDeferred() - launch { - service.outgoingStream(resumableFlow(fence)) - } - - serverInstance().firstIncomingConsumed.await() - - val secondServiceFlow = client - .withService() - .incomingStream() - - service.cancel("Test request cancelled") - service.join() - - serverInstances[1].fence.complete(Unit) - - val secondServiceResult = secondServiceFlow.toList() - - serverInstance().consumedAll.await() - - assertContentEquals(listOf(0), serverInstance().consumedIncomingValues) - assertContentEquals(List(2) { it }, secondServiceResult) - - stopAllAndJoin() - } - - @Test - fun testScopeClosureCancelsAllStreams() = runCancellationTest { - val fence = CompletableDeferred() - - service.outgoingStream(resumableFlow(fence)) - - client.withService().outgoingStream(resumableFlow(fence)) - - serverInstance().firstIncomingConsumed.await() - - while (true) { - if (serverInstances.size == 2) { - serverInstances[1].firstIncomingConsumed.await() - break - } - - unskippableDelay(50) - } - - serverInstances.forEach { it.consumedAll.await() } - - assertContentEquals(listOf(0), serverInstance().consumedIncomingValues) - assertContentEquals(listOf(0), serverInstances[1].consumedIncomingValues) - - stopAllAndJoin() - } - @Test fun testCancelledClientCancelsFlows() = runCancellationTest { val flow = service.incomingStream() + var caught: Throwable? = null + + flow.catch { + caught = it + }.collect { + if (it == 0) { + client.internalScope.cancel() + } else { + fail("Expected the request to fail with cancellation of the client") + } + } - assertEquals(0, flow.first()) - client.cancel() - val rest = flow.toList() - - assertTrue("Rest must be empty, as flow was closed") { rest.isEmpty() } + assertNotNull(caught, "Expected cancellation exception") stopAllAndJoin() } @@ -405,7 +254,7 @@ class CancellationTest { fun testCancelledClientCancelsRequest() = runCancellationTest { launch { serverInstance().firstIncomingConsumed.await() - client.cancel("Cancelled by test") + client.internalScope.cancel("Cancelled by test") } try { @@ -418,23 +267,6 @@ class CancellationTest { stopAllAndJoin() } - @Test - fun testCancelledServiceCancelsRequest() = runCancellationTest { - launch { - serverInstance().firstIncomingConsumed.await() - service.cancel("Cancelled by test") - } - - try { - service.longRequest() - fail("Expected the request to fail to cancellation") - } catch (_: CancellationException) { - // success - } - - stopAllAndJoin() - } - @Test fun testCancellingNonSuspendable() = runCancellationTest { val flow = service.nonSuspendable() @@ -494,14 +326,12 @@ class CancellationTest { } private fun CancellationToolkit.checkAlive( - serviceAlive: Boolean = true, clientAlive: Boolean = true, serverAlive: Boolean = true, transportAlive: Boolean = true, ) { - checkAlive(serviceAlive, service, "service") - checkAlive(clientAlive, client, "client") - checkAlive(serverAlive, server, "server") + checkAlive(clientAlive, client.internalScope, "client") + checkAlive(serverAlive, server.internalScope, "server") checkAlive(transportAlive, transport, "transport") } diff --git a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationToolkit.kt b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationToolkit.kt index 62685376..d8b71355 100644 --- a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationToolkit.kt +++ b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationToolkit.kt @@ -17,11 +17,14 @@ import kotlinx.rpc.krpc.serialization.json.json import kotlinx.rpc.krpc.test.KrpcTestClient import kotlinx.rpc.krpc.test.KrpcTestServer import kotlinx.rpc.krpc.test.LocalTransport +import kotlinx.rpc.krpc.test.debugCoroutines import kotlinx.rpc.registerService import kotlinx.rpc.withService +import kotlin.time.Duration.Companion.seconds fun runCancellationTest(body: suspend CancellationToolkit.() -> Unit): TestResult { - return runTest { + return runTest(timeout = 15.seconds) { + debugCoroutines() CancellationToolkit(this).apply { body() } } } @@ -61,7 +64,7 @@ class CancellationToolkit(scope: CoroutineScope) : CoroutineScope by scope { val server = KrpcTestServer(rpcServerConfig { serializationConfig() }, transport.server).apply { registerService { - CancellationServiceImpl(it).also { impl -> + CancellationServiceImpl().also { impl -> if (!firstServerInstance.isCompleted) { firstServerInstance.complete(impl) } diff --git a/krpc/krpc-test/src/jsMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.js.kt b/krpc/krpc-test/src/jsMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.js.kt index 79eaba18..e1cc1303 100644 --- a/krpc/krpc-test/src/jsMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.js.kt +++ b/krpc/krpc-test/src/jsMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.js.kt @@ -4,11 +4,12 @@ package kotlinx.rpc.krpc.test -import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.test.TestScope actual inline fun runThreadIfPossible(runner: () -> Unit) { runner() } -internal actual fun CoroutineScope.debugCoroutines() { +@Suppress("detekt.EmptyFunctionBlock") +internal actual fun TestScope.debugCoroutines() { } diff --git a/krpc/krpc-test/src/jvmMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.jvm.kt b/krpc/krpc-test/src/jvmMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.jvm.kt index f385e52f..864ee2d5 100644 --- a/krpc/krpc-test/src/jvmMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.jvm.kt +++ b/krpc/krpc-test/src/jvmMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.jvm.kt @@ -4,26 +4,15 @@ package kotlinx.rpc.krpc.test -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.debug.DebugProbes -import kotlinx.coroutines.delay -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext -import kotlin.time.Duration.Companion.seconds +import kotlinx.coroutines.test.TestScope actual fun runThreadIfPossible(runner: () -> Unit) { Thread(runner).start() } @OptIn(ExperimentalCoroutinesApi::class) -internal actual fun CoroutineScope.debugCoroutines() { +internal actual fun TestScope.debugCoroutines() { DebugProbes.install() - launch { - withContext(Dispatchers.IO) { - delay(10.seconds) - } - DebugProbes.dumpCoroutines() - } } diff --git a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/ApiVersioningTest.kt b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/ApiVersioningTest.kt index fd16c9ec..c99def24 100644 --- a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/ApiVersioningTest.kt +++ b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/ApiVersioningTest.kt @@ -89,8 +89,6 @@ class ApiVersioningTest { } } - private fun List>.join() = joinToString { "[${it.joinToString()}]" } - companion object { val LIBRARY_VERSION_DIR = System.getenv("LIBRARY_VERSION")?.versionToDirName() ?: error("Expected LIBRARY_VERSION env variable") diff --git a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/WireSamplingTestScope.kt b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/WireSamplingTestScope.kt index 2ccb266b..575a3014 100644 --- a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/WireSamplingTestScope.kt +++ b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/WireSamplingTestScope.kt @@ -30,6 +30,7 @@ import kotlinx.rpc.krpc.test.api.util.GoldComparable import kotlinx.rpc.krpc.test.api.util.GoldComparisonResult import kotlinx.rpc.krpc.test.api.util.GoldUtils import kotlinx.rpc.krpc.test.api.util.checkGold +import kotlinx.rpc.krpc.test.debugCoroutines import kotlinx.rpc.registerService import kotlinx.rpc.withService import kotlinx.serialization.ExperimentalSerializationApi @@ -38,10 +39,13 @@ import org.jetbrains.krpc.test.api.util.SamplingServiceImpl import java.nio.file.Files import java.nio.file.Path import kotlin.io.path.name +import kotlin.time.Duration.Companion.seconds @Suppress("RedundantUnitReturnType") fun wireSamplingTest(name: String, sampling: suspend WireSamplingTestScope.() -> Unit): TestResult { - return runTest { + return runTest(timeout = 15.seconds) { + debugCoroutines() + WireSamplingTestScope(name, this).apply { sampling() @@ -209,7 +213,7 @@ private class WireToolkit(scope: CoroutineScope, format: SamplingFormat, val log val server by lazy { KrpcTestServer(rpcServerConfig { serialization { format.init(this) } }, transport.server).apply { - registerService { SamplingServiceImpl(it) } + registerService { SamplingServiceImpl() } } } diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCPlugin.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCPlugin.gold deleted file mode 100644 index 4176f7d1..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCPlugin.gold +++ /dev/null @@ -1,4 +0,0 @@ -kotlinx.rpc.krpc.internal.RPCPlugin - UNKNOWN - HANDSHAKE - CANCELLATION \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCPluginKey.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCPluginKey.gold deleted file mode 100644 index 50c4302c..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCPluginKey.gold +++ /dev/null @@ -1,6 +0,0 @@ -kotlinx.rpc.krpc.internal.RPCPluginKey - UNKNOWN - GENERIC_MESSAGE_TYPE - CANCELLATION_TYPE - CANCELLATION_ID - CLIENT_SERVICE_ID \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallData.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallData.gold similarity index 63% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallData.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallData.gold index 41691ec4..d4581352 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallData.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallData.gold @@ -1,7 +1,7 @@ -org.jetbrains.krpc.internal.transport.RPCMessage.CallData [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallData] +org.jetbrains.krpc.internal.transport.RPCMessage.CallData [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallData] - callType: org.jetbrains.krpc.internal.transport.RPCMessage.CallType - Nullable - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallType + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallType - callableName: kotlin.String - callId: kotlin.String - connectionId: kotlin.Long @@ -13,6 +13,6 @@ org.jetbrains.krpc.internal.transport.RPCMessage.CallData [Declared name: kotlin - serviceType: kotlin.String org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallDataBinary + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallDataBinary org.jetbrains.krpc.RPCMessage.CallData - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallDataString \ No newline at end of file + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallDataString \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallDataBinary.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallDataBinary.gold similarity index 74% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallDataBinary.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallDataBinary.gold index 5413c567..b0edd5b4 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallDataBinary.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallDataBinary.gold @@ -1,8 +1,8 @@ -org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallDataBinary] +org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallDataBinary] - callId: kotlin.String - callType: org.jetbrains.krpc.internal.transport.RPCMessage.CallType - Nullable - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallType + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallType - method: kotlin.String - Declared name: callableName - connectionId: kotlin.Long diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallDataString.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallDataString.gold similarity index 78% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallDataString.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallDataString.gold index 35cc4b87..b9ba5971 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallDataString.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallDataString.gold @@ -1,8 +1,8 @@ -org.jetbrains.krpc.RPCMessage.CallData [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallDataString] +org.jetbrains.krpc.RPCMessage.CallData [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallDataString] - callId: kotlin.String - callType: org.jetbrains.krpc.internal.transport.RPCMessage.CallType - Nullable - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallType + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallType - method: kotlin.String - Declared name: callableName - connectionId: kotlin.Long diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallException.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallException.gold similarity index 87% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallException.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallException.gold index 9918a124..3b7dfc0e 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallException.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallException.gold @@ -1,4 +1,4 @@ -org.jetbrains.krpc.RPCMessage.CallException [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallException] +org.jetbrains.krpc.RPCMessage.CallException [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallException] - callId: kotlin.String - cause: org.jetbrains.krpc.SerializedException - Declared name: kotlinx.rpc.krpc.internal.SerializedException diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallResult.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallResult.gold similarity index 65% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallResult.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallResult.gold index 2756efe7..2e7672b9 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallResult.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallResult.gold @@ -1,4 +1,4 @@ -org.jetbrains.krpc.RPCMessage.CallResult [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallResult] +org.jetbrains.krpc.RPCMessage.CallResult [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallResult] - callId: kotlin.String - connectionId: kotlin.Long - Nullable @@ -9,6 +9,6 @@ org.jetbrains.krpc.RPCMessage.CallResult [Declared name: kotlinx.rpc.krpc.intern - serviceType: kotlin.String org.jetbrains.krpc.RPCMessage.CallException - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallException + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallException org.jetbrains.krpc.internal.transport.RPCMessage.CallSuccess - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallSuccess \ No newline at end of file + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallSuccess \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallSuccess.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallSuccess.gold similarity index 62% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallSuccess.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallSuccess.gold index 25876358..f34c74a7 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallSuccess.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallSuccess.gold @@ -1,4 +1,4 @@ -org.jetbrains.krpc.internal.transport.RPCMessage.CallSuccess [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallSuccess] +org.jetbrains.krpc.internal.transport.RPCMessage.CallSuccess [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallSuccess] - callId: kotlin.String - connectionId: kotlin.Long - Nullable @@ -9,6 +9,6 @@ org.jetbrains.krpc.internal.transport.RPCMessage.CallSuccess [Declared name: kot - serviceType: kotlin.String org.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallSuccessBinary + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallSuccessBinary org.jetbrains.krpc.RPCMessage.CallSuccess - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallSuccessString \ No newline at end of file + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallSuccessString \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallSuccessBinary.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallSuccessBinary.gold similarity index 78% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallSuccessBinary.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallSuccessBinary.gold index a970d3fd..e8cd5890 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallSuccessBinary.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallSuccessBinary.gold @@ -1,4 +1,4 @@ -org.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallSuccessBinary] +org.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallSuccessBinary] - callId: kotlin.String - connectionId: kotlin.Long - Nullable diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallSuccessString.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallSuccessString.gold similarity index 83% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallSuccessString.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallSuccessString.gold index 1bc411c8..34c96185 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallSuccessString.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallSuccessString.gold @@ -1,4 +1,4 @@ -org.jetbrains.krpc.RPCMessage.CallSuccess [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallSuccessString] +org.jetbrains.krpc.RPCMessage.CallSuccess [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallSuccessString] - callId: kotlin.String - connectionId: kotlin.Long - Nullable diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallType.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallType.gold similarity index 56% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallType.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallType.gold index 53641ac6..84b5971b 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/CallType.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/CallType.gold @@ -1,3 +1,3 @@ -org.jetbrains.krpc.internal.transport.RPCMessage.CallType [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallType] +org.jetbrains.krpc.internal.transport.RPCMessage.CallType [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallType] Method Field \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/Failure.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/Failure.gold similarity index 66% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/Failure.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/Failure.gold index 040889b1..f01da216 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/Failure.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/Failure.gold @@ -1,8 +1,8 @@ -org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Failure [Declared name: kotlinx.rpc.krpc.internal.RPCProtocolMessage.Failure] +org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Failure [Declared name: kotlinx.rpc.krpc.internal.KrpcProtocolMessage.Failure] - connectionId: kotlin.Long - Nullable - errorMessage: kotlin.String - failedMessage: org.jetbrains.krpc.internal.transport.RPCMessage - Nullable - - Declared name: kotlinx.rpc.krpc.internal.RPCMessage + - Declared name: kotlinx.rpc.krpc.internal.KrpcMessage - pluginParams: kotlin.collections.Map \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/Handshake.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/Handshake.gold similarity index 71% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/Handshake.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/Handshake.gold index 91dd33f3..2f5e2be8 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/Handshake.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/Handshake.gold @@ -1,4 +1,4 @@ -org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake [Declared name: kotlinx.rpc.krpc.internal.RPCProtocolMessage.Handshake] +org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake [Declared name: kotlinx.rpc.krpc.internal.KrpcProtocolMessage.Handshake] - connectionId: kotlin.Long - Nullable - pluginParams: kotlin.collections.Map diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCCallMessage.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcCallMessage.gold similarity index 57% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCCallMessage.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcCallMessage.gold index f600a160..0273b93a 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCCallMessage.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcCallMessage.gold @@ -1,4 +1,4 @@ -org.jetbrains.krpc.RPCMessage [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage] +org.jetbrains.krpc.RPCMessage [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage] - callId: kotlin.String - serviceId: kotlin.Long - Nullable @@ -9,12 +9,12 @@ org.jetbrains.krpc.RPCMessage [Declared name: kotlinx.rpc.krpc.internal.RPCCallM - Nullable org.jetbrains.krpc.internal.transport.RPCMessage.CallData - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallData + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallData org.jetbrains.krpc.RPCMessage.CallResult - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.CallResult + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallResult org.jetbrains.krpc.RPCMessage.StreamCancel - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.StreamCancel + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.StreamCancel org.jetbrains.krpc.RPCMessage.StreamFinished - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.StreamFinished + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.StreamFinished org.jetbrains.krpc.internal.transport.RPCMessage.StreamMessage - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.StreamMessage \ No newline at end of file + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.StreamMessage \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCGenericMessage.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcGenericMessage.gold similarity index 75% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCGenericMessage.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcGenericMessage.gold index d348496e..b27a3f00 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCGenericMessage.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcGenericMessage.gold @@ -1,4 +1,4 @@ -org.jetbrains.krpc.internal.transport.RPCGenericMessage [Declared name: kotlinx.rpc.krpc.internal.RPCGenericMessage] +org.jetbrains.krpc.internal.transport.RPCGenericMessage [Declared name: kotlinx.rpc.krpc.internal.KrpcGenericMessage] - connectionId: kotlin.Long - Nullable - pluginParams: kotlin.collections.Map diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCMessage.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcMessage.gold similarity index 57% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCMessage.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcMessage.gold index 08a35a54..6924a1c4 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCMessage.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcMessage.gold @@ -1,12 +1,12 @@ -org.jetbrains.krpc.internal.transport.RPCMessage [Declared name: kotlinx.rpc.krpc.internal.RPCMessage] +org.jetbrains.krpc.internal.transport.RPCMessage [Declared name: kotlinx.rpc.krpc.internal.KrpcMessage] - connectionId: kotlin.Long - Nullable - pluginParams: kotlin.collections.Map - Nullable org.jetbrains.krpc.RPCMessage - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage org.jetbrains.krpc.internal.transport.RPCGenericMessage - - Declared name: kotlinx.rpc.krpc.internal.RPCGenericMessage + - Declared name: kotlinx.rpc.krpc.internal.KrpcGenericMessage org.jetbrains.krpc.internal.transport.RPCProtocolMessage - - Declared name: kotlinx.rpc.krpc.internal.RPCProtocolMessage \ No newline at end of file + - Declared name: kotlinx.rpc.krpc.internal.KrpcProtocolMessage \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcPlugin.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcPlugin.gold new file mode 100644 index 00000000..0735462c --- /dev/null +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcPlugin.gold @@ -0,0 +1,6 @@ +kotlinx.rpc.krpc.internal.KrpcPlugin + UNKNOWN + HANDSHAKE + CANCELLATION + NON_SUSPENDING_SERVER_FLOWS + NO_ACK_CANCELLATION \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcPluginKey.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcPluginKey.gold new file mode 100644 index 00000000..137d218c --- /dev/null +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcPluginKey.gold @@ -0,0 +1,7 @@ +kotlinx.rpc.krpc.internal.KrpcPluginKey + UNKNOWN + GENERIC_MESSAGE_TYPE + CANCELLATION_TYPE + CANCELLATION_ID + CLIENT_SERVICE_ID + NON_SUSPENDING_SERVER_FLOW_MARKER \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCProtocolMessage.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcProtocolMessage.gold similarity index 58% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCProtocolMessage.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcProtocolMessage.gold index 87d80d02..7e80aac1 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/RPCProtocolMessage.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/KrpcProtocolMessage.gold @@ -1,9 +1,9 @@ -org.jetbrains.krpc.internal.transport.RPCProtocolMessage [Declared name: kotlinx.rpc.krpc.internal.RPCProtocolMessage] +org.jetbrains.krpc.internal.transport.RPCProtocolMessage [Declared name: kotlinx.rpc.krpc.internal.KrpcProtocolMessage] - pluginParams: kotlin.collections.Map - connectionId: kotlin.Long - Nullable org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Failure - - Declared name: kotlinx.rpc.krpc.internal.RPCProtocolMessage.Failure + - Declared name: kotlinx.rpc.krpc.internal.KrpcProtocolMessage.Failure org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake - - Declared name: kotlinx.rpc.krpc.internal.RPCProtocolMessage.Handshake \ No newline at end of file + - Declared name: kotlinx.rpc.krpc.internal.KrpcProtocolMessage.Handshake \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/SerializedException.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/SerializedException.gold similarity index 100% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/SerializedException.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/SerializedException.gold diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StackElement.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StackElement.gold similarity index 100% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StackElement.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StackElement.gold diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamCancel.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamCancel.gold similarity index 89% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamCancel.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamCancel.gold index ac17cf82..8e6bd5e5 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamCancel.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamCancel.gold @@ -1,4 +1,4 @@ -org.jetbrains.krpc.RPCMessage.StreamCancel [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.StreamCancel] +org.jetbrains.krpc.RPCMessage.StreamCancel [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.StreamCancel] - callId: kotlin.String - cause: org.jetbrains.krpc.SerializedException - Declared name: kotlinx.rpc.krpc.internal.SerializedException diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamFinished.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamFinished.gold similarity index 85% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamFinished.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamFinished.gold index 8f782fdf..a260d7d7 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamFinished.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamFinished.gold @@ -1,4 +1,4 @@ -org.jetbrains.krpc.RPCMessage.StreamFinished [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.StreamFinished] +org.jetbrains.krpc.RPCMessage.StreamFinished [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.StreamFinished] - callId: kotlin.String - connectionId: kotlin.Long - Nullable diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamMessage.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamMessage.gold similarity index 63% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamMessage.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamMessage.gold index 7d2d2b4b..e0748591 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamMessage.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamMessage.gold @@ -1,4 +1,4 @@ -org.jetbrains.krpc.internal.transport.RPCMessage.StreamMessage [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.StreamMessage] +org.jetbrains.krpc.internal.transport.RPCMessage.StreamMessage [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.StreamMessage] - streamId: kotlin.String - callId: kotlin.String - connectionId: kotlin.Long @@ -10,6 +10,6 @@ org.jetbrains.krpc.internal.transport.RPCMessage.StreamMessage [Declared name: k - serviceType: kotlin.String org.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.StreamMessageBinary + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.StreamMessageBinary org.jetbrains.krpc.RPCMessage.StreamMessage - - Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.StreamMessageString \ No newline at end of file + - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.StreamMessageString \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamMessageBinary.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamMessageBinary.gold similarity index 80% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamMessageBinary.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamMessageBinary.gold index a48ca983..6da67510 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamMessageBinary.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamMessageBinary.gold @@ -1,4 +1,4 @@ -org.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.StreamMessageBinary] +org.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.StreamMessageBinary] - callId: kotlin.String - connectionId: kotlin.Long - Nullable diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamMessageString.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamMessageString.gold similarity index 85% rename from krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamMessageString.gold rename to krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamMessageString.gold index 23d4f444..3316fc14 100644 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_1_0/StreamMessageString.gold +++ b/krpc/krpc-test/src/jvmTest/resources/class_dumps/0_8_0/StreamMessageString.gold @@ -1,4 +1,4 @@ -org.jetbrains.krpc.RPCMessage.StreamMessage [Declared name: kotlinx.rpc.krpc.internal.RPCCallMessage.StreamMessageString] +org.jetbrains.krpc.RPCMessage.StreamMessage [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.StreamMessageString] - callId: kotlin.String - connectionId: kotlin.Long - Nullable diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/CallData.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/CallData.gold deleted file mode 100644 index 30b7228d..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/CallData.gold +++ /dev/null @@ -1,6 +0,0 @@ -org.jetbrains.krpc.RPCMessage.CallData - - callId: kotlin.String - - method: kotlin.String - - Declared name: callableName - - data: kotlin.String - - serviceType: kotlin.String \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/CallException.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/CallException.gold deleted file mode 100644 index 8084f57e..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/CallException.gold +++ /dev/null @@ -1,4 +0,0 @@ -org.jetbrains.krpc.RPCMessage.CallException - - callId: kotlin.String - - cause: org.jetbrains.krpc.SerializedException - - serviceType: kotlin.String \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/CallResult.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/CallResult.gold deleted file mode 100644 index a84cf218..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/CallResult.gold +++ /dev/null @@ -1,6 +0,0 @@ -org.jetbrains.krpc.RPCMessage.CallResult - - callId: kotlin.String - - serviceType: kotlin.String - - org.jetbrains.krpc.RPCMessage.CallException - org.jetbrains.krpc.RPCMessage.CallSuccess \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/CallSuccess.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/CallSuccess.gold deleted file mode 100644 index 7d43fb77..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/CallSuccess.gold +++ /dev/null @@ -1,4 +0,0 @@ -org.jetbrains.krpc.RPCMessage.CallSuccess - - callId: kotlin.String - - data: kotlin.String - - serviceType: kotlin.String \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/RPCMessage.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/RPCMessage.gold deleted file mode 100644 index 7a519518..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/RPCMessage.gold +++ /dev/null @@ -1,9 +0,0 @@ -org.jetbrains.krpc.RPCMessage - - callId: kotlin.String - - serviceType: kotlin.String - - org.jetbrains.krpc.RPCMessage.CallData - org.jetbrains.krpc.RPCMessage.CallResult - org.jetbrains.krpc.RPCMessage.StreamCancel - org.jetbrains.krpc.RPCMessage.StreamFinished - org.jetbrains.krpc.RPCMessage.StreamMessage \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/SerializedException.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/SerializedException.gold deleted file mode 100644 index f41665be..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/SerializedException.gold +++ /dev/null @@ -1,7 +0,0 @@ -org.jetbrains.krpc.SerializedException - - cause: org.jetbrains.krpc.SerializedException - - Nullable - - className: kotlin.String - - message: kotlin.String - - stacktrace: kotlin.collections.List - - toStringMessage: kotlin.String \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/StackElement.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/StackElement.gold deleted file mode 100644 index 301ab911..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/StackElement.gold +++ /dev/null @@ -1,6 +0,0 @@ -org.jetbrains.krpc.StackElement - - clazz: kotlin.String - - fileName: kotlin.String - - Nullable - - lineNumber: kotlin.Int - - method: kotlin.String \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/StreamCancel.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/StreamCancel.gold deleted file mode 100644 index 0bcfd6a3..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/StreamCancel.gold +++ /dev/null @@ -1,6 +0,0 @@ -org.jetbrains.krpc.RPCMessage.StreamCancel - - callId: kotlin.String - - cause: org.jetbrains.krpc.SerializedException - - serviceType: kotlin.String - - flowId: kotlin.String - - Declared name: streamId \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/StreamFinished.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/StreamFinished.gold deleted file mode 100644 index 2fdb1928..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/StreamFinished.gold +++ /dev/null @@ -1,5 +0,0 @@ -org.jetbrains.krpc.RPCMessage.StreamFinished - - callId: kotlin.String - - serviceType: kotlin.String - - flowId: kotlin.String - - Declared name: streamId \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/StreamMessage.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/StreamMessage.gold deleted file mode 100644 index 164a434a..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/4_2_beta/StreamMessage.gold +++ /dev/null @@ -1,6 +0,0 @@ -org.jetbrains.krpc.RPCMessage.StreamMessage - - callId: kotlin.String - - data: kotlin.String - - serviceType: kotlin.String - - flowId: kotlin.String - - Declared name: streamId \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallData.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallData.gold deleted file mode 100644 index c50fb64c..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallData.gold +++ /dev/null @@ -1,10 +0,0 @@ -org.jetbrains.krpc.internal.transport.RPCMessage.CallData - - callType: org.jetbrains.krpc.internal.transport.RPCMessage.CallType - - Nullable - - callableName: kotlin.String - - callId: kotlin.String - - serviceType: kotlin.String - - org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary - org.jetbrains.krpc.RPCMessage.CallData - - Declared name: org.jetbrains.krpc.internal.transport.RPCMessage.CallDataString \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallDataBinary.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallDataBinary.gold deleted file mode 100644 index de72728d..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallDataBinary.gold +++ /dev/null @@ -1,8 +0,0 @@ -org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary - - callId: kotlin.String - - callType: org.jetbrains.krpc.internal.transport.RPCMessage.CallType - - Nullable - - method: kotlin.String - - Declared name: callableName - - data: kotlin.ByteArray - - serviceType: kotlin.String \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallDataString.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallDataString.gold deleted file mode 100644 index 16d56913..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallDataString.gold +++ /dev/null @@ -1,8 +0,0 @@ -org.jetbrains.krpc.RPCMessage.CallData [Declared name: org.jetbrains.krpc.internal.transport.RPCMessage.CallDataString] - - callId: kotlin.String - - callType: org.jetbrains.krpc.internal.transport.RPCMessage.CallType - - Nullable - - method: kotlin.String - - Declared name: callableName - - data: kotlin.String - - serviceType: kotlin.String \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallException.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallException.gold deleted file mode 100644 index 98b4c5d7..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallException.gold +++ /dev/null @@ -1,5 +0,0 @@ -org.jetbrains.krpc.RPCMessage.CallException [Declared name: org.jetbrains.krpc.internal.transport.RPCMessage.CallException] - - callId: kotlin.String - - cause: org.jetbrains.krpc.SerializedException - - Declared name: org.jetbrains.krpc.internal.transport.SerializedException - - serviceType: kotlin.String \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallResult.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallResult.gold deleted file mode 100644 index 1c43e601..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallResult.gold +++ /dev/null @@ -1,7 +0,0 @@ -org.jetbrains.krpc.RPCMessage.CallResult [Declared name: org.jetbrains.krpc.internal.transport.RPCMessage.CallResult] - - callId: kotlin.String - - serviceType: kotlin.String - - org.jetbrains.krpc.RPCMessage.CallException - - Declared name: org.jetbrains.krpc.internal.transport.RPCMessage.CallException - org.jetbrains.krpc.internal.transport.RPCMessage.CallSuccess \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallSuccess.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallSuccess.gold deleted file mode 100644 index f75972d3..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallSuccess.gold +++ /dev/null @@ -1,7 +0,0 @@ -org.jetbrains.krpc.internal.transport.RPCMessage.CallSuccess - - callId: kotlin.String - - serviceType: kotlin.String - - org.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary - org.jetbrains.krpc.RPCMessage.CallSuccess - - Declared name: org.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessString \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallSuccessBinary.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallSuccessBinary.gold deleted file mode 100644 index 6188fccb..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallSuccessBinary.gold +++ /dev/null @@ -1,4 +0,0 @@ -org.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary - - callId: kotlin.String - - data: kotlin.ByteArray - - serviceType: kotlin.String \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallSuccessString.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallSuccessString.gold deleted file mode 100644 index 3a745009..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallSuccessString.gold +++ /dev/null @@ -1,4 +0,0 @@ -org.jetbrains.krpc.RPCMessage.CallSuccess [Declared name: org.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessString] - - callId: kotlin.String - - data: kotlin.String - - serviceType: kotlin.String \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallType.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallType.gold deleted file mode 100644 index 05e5d218..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/CallType.gold +++ /dev/null @@ -1,3 +0,0 @@ -org.jetbrains.krpc.internal.transport.RPCMessage.CallType - Method - Field \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/RPCMessage.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/RPCMessage.gold deleted file mode 100644 index 9ce6c01c..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/RPCMessage.gold +++ /dev/null @@ -1,12 +0,0 @@ -org.jetbrains.krpc.RPCMessage [Declared name: org.jetbrains.krpc.internal.transport.RPCMessage] - - callId: kotlin.String - - serviceType: kotlin.String - - org.jetbrains.krpc.internal.transport.RPCMessage.CallData - org.jetbrains.krpc.RPCMessage.CallResult - - Declared name: org.jetbrains.krpc.internal.transport.RPCMessage.CallResult - org.jetbrains.krpc.RPCMessage.StreamCancel - - Declared name: org.jetbrains.krpc.internal.transport.RPCMessage.StreamCancel - org.jetbrains.krpc.RPCMessage.StreamFinished - - Declared name: org.jetbrains.krpc.internal.transport.RPCMessage.StreamFinished - org.jetbrains.krpc.internal.transport.RPCMessage.StreamMessage \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/SerializedException.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/SerializedException.gold deleted file mode 100644 index 1d9410c0..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/SerializedException.gold +++ /dev/null @@ -1,8 +0,0 @@ -org.jetbrains.krpc.SerializedException [Declared name: kotlinx.rpc.internal.transport.SerializedException] - - cause: org.jetbrains.krpc.SerializedException - - Nullable - - Declared name: kotlinx.rpc.internal.transport.SerializedException - - className: kotlin.String - - message: kotlin.String - - stacktrace: kotlin.collections.List - - toStringMessage: kotlin.String \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StackElement.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StackElement.gold deleted file mode 100644 index af58763d..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StackElement.gold +++ /dev/null @@ -1,6 +0,0 @@ -org.jetbrains.krpc.StackElement [Declared name: kotlinx.rpc.internal.transport.StackElement] - - clazz: kotlin.String - - fileName: kotlin.String - - Nullable - - lineNumber: kotlin.Int - - method: kotlin.String \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamCancel.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamCancel.gold deleted file mode 100644 index b6328c90..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamCancel.gold +++ /dev/null @@ -1,7 +0,0 @@ -org.jetbrains.krpc.RPCMessage.StreamCancel [Declared name: org.jetbrains.krpc.internal.transport.RPCMessage.StreamCancel] - - callId: kotlin.String - - cause: org.jetbrains.krpc.SerializedException - - Declared name: org.jetbrains.krpc.internal.transport.SerializedException - - serviceType: kotlin.String - - flowId: kotlin.String - - Declared name: streamId \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamFinished.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamFinished.gold deleted file mode 100644 index 4cc57723..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamFinished.gold +++ /dev/null @@ -1,5 +0,0 @@ -org.jetbrains.krpc.RPCMessage.StreamFinished [Declared name: org.jetbrains.krpc.internal.transport.RPCMessage.StreamFinished] - - callId: kotlin.String - - serviceType: kotlin.String - - flowId: kotlin.String - - Declared name: streamId \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamMessage.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamMessage.gold deleted file mode 100644 index f946eeb9..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamMessage.gold +++ /dev/null @@ -1,8 +0,0 @@ -org.jetbrains.krpc.internal.transport.RPCMessage.StreamMessage - - streamId: kotlin.String - - callId: kotlin.String - - serviceType: kotlin.String - - org.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary - org.jetbrains.krpc.RPCMessage.StreamMessage - - Declared name: org.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageString \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamMessageBinary.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamMessageBinary.gold deleted file mode 100644 index ca3d8e5d..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamMessageBinary.gold +++ /dev/null @@ -1,6 +0,0 @@ -org.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary - - callId: kotlin.String - - data: kotlin.ByteArray - - serviceType: kotlin.String - - flowId: kotlin.String - - Declared name: streamId \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamMessageString.gold b/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamMessageString.gold deleted file mode 100644 index 2a5bd168..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/class_dumps/5_3_beta/StreamMessageString.gold +++ /dev/null @@ -1,6 +0,0 @@ -org.jetbrains.krpc.RPCMessage.StreamMessage [Declared name: org.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageString] - - callId: kotlin.String - - data: kotlin.String - - serviceType: kotlin.String - - flowId: kotlin.String - - Declared name: streamId \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/indexed_enum_dumps/KrpcPlugin.gold b/krpc/krpc-test/src/jvmTest/resources/indexed_enum_dumps/KrpcPlugin.gold index 7733354c..1317fc12 100644 --- a/krpc/krpc-test/src/jvmTest/resources/indexed_enum_dumps/KrpcPlugin.gold +++ b/krpc/krpc-test/src/jvmTest/resources/indexed_enum_dumps/KrpcPlugin.gold @@ -1,4 +1,5 @@ UNKNOWN - 0 HANDSHAKE - 1 CANCELLATION - 2 -NON_SUSPENDING_SERVER_FLOWS - 3 \ No newline at end of file +NON_SUSPENDING_SERVER_FLOWS - 3 +NO_ACK_CANCELLATION - 4 \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/callException_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/callException_json.gold deleted file mode 100644 index 684eab40..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/callException_json.gold +++ /dev/null @@ -1,8 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:kotlinx.rpc.SamplingServiceClient.CallException_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"callException","callType":"Method","data":"{}","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:kotlinx.rpc.SamplingServiceClient.CallException_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"callException","callType":"Method","data":"{}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallException","callId":"1:kotlinx.rpc.SamplingServiceClient.CallException_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":null,"className":"java.lang.IllegalStateException"},"connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallException","callId":"1:kotlinx.rpc.SamplingServiceClient.CallException_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":null,"className":"java.lang.IllegalStateException"},"connectionId":1,"serviceId":1} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/clientStream_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/clientStream_json.gold deleted file mode 100644 index fd230e3c..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/clientStream_json.gold +++ /dev/null @@ -1,20 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"clientStream","callType":"Method","data":"{\"flow\":\"stream:0\"}","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"clientStream","callType":"Method","data":"{\"flow\":\"stream:0\"}","connectionId":1,"serviceId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"0","connectionId":1,"serviceId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"1","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"0","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"1","connectionId":1,"serviceId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"2","connectionId":1,"serviceId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"3","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"2","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"3","connectionId":1,"serviceId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"4","connectionId":1,"serviceId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamFinished","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"4","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamFinished","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"[0,1,2,3,4]","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"[0,1,2,3,4]","connectionId":1,"serviceId":1} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/clientStream_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/clientStream_protobuf.gold deleted file mode 100644 index 55182390..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/clientStream_protobuf.gold +++ /dev/null @@ -1,40 +0,0 @@ -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Client] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Server] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??clientStream ?*???stream:00?8? -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791295010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0c636c69656e7453747265616d20002a0a0a0873747265616d3a3030013801 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??clientStream ?*???stream:00?8? -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791295010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0c636c69656e7453747265616d20002a0a0a0873747265616d3a3030013801 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791286010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010028013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791286010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010128013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791286010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010028013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791286010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010128013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791286010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010228013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791286010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010328013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791286010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010228013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791286010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010328013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791286010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010428013001 -// decoded: ?,org.jetbrains.krpc.RPCMessage.StreamFinished????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0 ?(? -[Client] [Send] $ 0a2c6f72672e6a6574627261696e732e6b7270632e5250434d6573736167652e53747265616d46696e69736865641283010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3020012801 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791286010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010428013001 -// decoded: ?,org.jetbrains.krpc.RPCMessage.StreamFinished????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0 ?(? -[Server] [Receive] $ 0a2c6f72672e6a6574627261696e732e6b7270632e5250434d6573736167652e53747265616d46696e69736865641283010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3020012801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService???????? ?(? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e6172791281010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0605000102030420012801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService???????? ?(? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e6172791281010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0605000102030420012801 \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/echo_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/echo_json.gold deleted file mode 100644 index 263c006a..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/echo_json.gold +++ /dev/null @@ -1,8 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"echo","callType":"Method","data":"{\"arg1\":\"Hello\",\"data\":{\"data\":\"data\"}}","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"echo","callType":"Method","data":"{\"arg1\":\"Hello\",\"data\":{\"data\":\"data\"}}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/echo_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/echo_protobuf.gold deleted file mode 100644 index e18195d3..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/echo_protobuf.gold +++ /dev/null @@ -1,16 +0,0 @@ -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Client] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Server] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????21:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??echo ?*???Hello????data0?8? -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791283010a32313a6b6f746c696e782e7270632e53616d706c696e6753657276696365436c69656e742e4563686f5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a046563686f20002a0f0a0548656c6c6f12060a046461746130013801 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????21:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??echo ?*???Hello????data0?8? -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791283010a32313a6b6f746c696e782e7270632e53616d706c696e6753657276696365436c69656e742e4563686f5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a046563686f20002a0f0a0548656c6c6f12060a046461746130013801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?r?21:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService????data ?(? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912720a32313a6b6f746c696e782e7270632e53616d706c696e6753657276696365436c69656e742e4563686f5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a060a046461746120012801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?r?21:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService????data ?(? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912720a32313a6b6f746c696e782e7270632e53616d706c696e6753657276696365436c69656e742e4563686f5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a060a046461746120012801 \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/plainFlow_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/plainFlow_json.gold deleted file mode 100644 index 4b81c927..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/plainFlow_json.gold +++ /dev/null @@ -1,20 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"plainFlow","callType":"Field","data":"{}","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"plainFlow","callType":"Field","data":"{}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\"","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\"","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"0","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"1","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"0","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"1","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"2","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"3","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"2","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"3","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"4","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamFinished","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"4","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamFinished","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","connectionId":1,"serviceId":1} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/plainFlow_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/plainFlow_protobuf.gold deleted file mode 100644 index 2021a232..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/plainFlow_protobuf.gold +++ /dev/null @@ -1,40 +0,0 @@ -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Client] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Server] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?}?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??plainFlow ?*?0?8? -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e617279127d0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a09706c61696e466c6f7720012a0030013801 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?}?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??plainFlow ?*?0?8? -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e617279127d0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a09706c61696e466c6f7720012a0030013801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?y?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0 ?(? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912790a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a090873747265616d3a3020012801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?y?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0 ?(? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912790a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a090873747265616d3a3020012801 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010028013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010128013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010028013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010128013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010228013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010328013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010228013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010328013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010428013001 -// decoded: ?,org.jetbrains.krpc.RPCMessage.StreamFinished?x?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0 ?(? -[Server] [Send] $ 0a2c6f72672e6a6574627261696e732e6b7270632e5250434d6573736167652e53747265616d46696e697368656412780a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3020012801 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010428013001 -// decoded: ?,org.jetbrains.krpc.RPCMessage.StreamFinished?x?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0 ?(? -[Client] [Receive] $ 0a2c6f72672e6a6574627261696e732e6b7270632e5250434d6573736167652e53747265616d46696e697368656412780a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3020012801 \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/serverStream_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/serverStream_json.gold deleted file mode 100644 index 3d4c8ecf..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/serverStream_json.gold +++ /dev/null @@ -1,20 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"serverFlow","callType":"Method","data":"{}","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"serverFlow","callType":"Method","data":"{}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\"","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\"","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamFinished","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamFinished","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","connectionId":1,"serviceId":1} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/serverStream_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/serverStream_protobuf.gold deleted file mode 100644 index ffc0b268..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/serverStream_protobuf.gold +++ /dev/null @@ -1,40 +0,0 @@ -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Client] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Server] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??serverFlow ?*?0?8? -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791287010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0a736572766572466c6f7720002a0030013801 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??serverFlow ?*?0?8? -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791287010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0a736572766572466c6f7720002a0030013801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0 ?(? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e6172791282010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a090873747265616d3a3020012801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0 ?(? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e6172791282010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a090873747265616d3a3020012801 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791289010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a046461746128013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791289010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a046461746128013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791289010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a046461746128013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791289010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a046461746128013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791289010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a046461746128013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791289010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a046461746128013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791289010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a046461746128013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791289010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a046461746128013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791289010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a046461746128013001 -// decoded: ?,org.jetbrains.krpc.RPCMessage.StreamFinished?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0 ?(? -[Server] [Send] $ 0a2c6f72672e6a6574627261696e732e6b7270632e5250434d6573736167652e53747265616d46696e69736865641281010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3020012801 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791289010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a046461746128013001 -// decoded: ?,org.jetbrains.krpc.RPCMessage.StreamFinished?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0 ?(? -[Client] [Receive] $ 0a2c6f72672e6a6574627261696e732e6b7270632e5250434d6573736167652e53747265616d46696e69736865641281010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3020012801 \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/sharedFlow_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/sharedFlow_json.gold deleted file mode 100644 index 06afa54d..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/sharedFlow_json.gold +++ /dev/null @@ -1,18 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"sharedFlow","callType":"Field","data":"{}","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"sharedFlow","callType":"Field","data":"{}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\"","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\"","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"0","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"1","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"0","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"1","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"2","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"3","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"2","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"3","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"4","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"4","connectionId":1,"serviceId":1} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/sharedFlow_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/sharedFlow_protobuf.gold deleted file mode 100644 index 2cb051a2..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/sharedFlow_protobuf.gold +++ /dev/null @@ -1,36 +0,0 @@ -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Client] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Server] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?~?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??sharedFlow ?*?0?8? -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e617279127e0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0a736861726564466c6f7720012a0030013801 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?~?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??sharedFlow ?*?0?8? -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e617279127e0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0a736861726564466c6f7720012a0030013801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?y?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0 ?(? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912790a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a090873747265616d3a3020012801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?y?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0 ?(? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912790a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a090873747265616d3a3020012801 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010028013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010128013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010028013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010128013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010228013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010328013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010228013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010328013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010428013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010428013001 \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/stateFlow_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/stateFlow_json.gold deleted file mode 100644 index fc797910..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/stateFlow_json.gold +++ /dev/null @@ -1,16 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"stateFlow","callType":"Field","data":"{}","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"stateFlow","callType":"Field","data":"{}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\"-1","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\"-1","connectionId":1,"serviceId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"emitNextInStateFlow","callType":"Method","data":"{\"next\":10}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"-1","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"emitNextInStateFlow","callType":"Method","data":"{\"next\":10}","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"-1","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{}","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"10","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"10","connectionId":1,"serviceId":1} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/stateFlow_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/stateFlow_protobuf.gold deleted file mode 100644 index 2cf47334..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_1_0/stateFlow_protobuf.gold +++ /dev/null @@ -1,32 +0,0 @@ -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Client] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Server] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?}?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stateFlow ?*?0?8? -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e617279127d0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a097374617465466c6f7720012a0030013801 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?}?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stateFlow ?*?0?8? -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e617279127d0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a097374617465466c6f7720012a0030013801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary????61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0?????????? ?(? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e6172791283010a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a130873747265616d3a30ffffffffffffffffff0120012801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary????61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0?????????? ?(? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e6172791283010a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a130873747265616d3a30ffffffffffffffffff0120012801 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????H1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2?0org.jetbrains.krpc.test.api.util.SamplingService??emitNextInStateFlow ?*???0?8? -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e617279129b010a48313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e456d69744e657874496e5374617465466c6f775f525043446174613a3212306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a13656d69744e657874496e5374617465466c6f7720002a02080a30013801 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???????????(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791284010a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220affffffffffffffffff0128013001 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????H1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2?0org.jetbrains.krpc.test.api.util.SamplingService??emitNextInStateFlow ?*???0?8? -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e617279129b010a48313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e456d69744e657874496e5374617465466c6f775f525043446174613a3212306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a13656d69744e657874496e5374617465466c6f7720002a02080a30013801 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???????????(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791284010a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220affffffffffffffffff0128013001 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary????H1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2?0org.jetbrains.krpc.test.api.util.SamplingService?? ?(? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e6172791282010a48313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e456d69744e657874496e5374617465466c6f775f525043446174613a3212306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0020012801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary????H1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2?0org.jetbrains.krpc.test.api.util.SamplingService?? ?(? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e6172791282010a48313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e456d69744e657874496e5374617465466c6f775f525043446174613a3212306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0020012801 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010a28013001 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?{?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??(?0? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e617279127b0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010a28013001 \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_1/callException_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_1/callException_json.gold deleted file mode 100644 index 6c996c8f..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_1/callException_json.gold +++ /dev/null @@ -1,10 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:kotlinx.rpc.SamplingServiceClient.CallException_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"callException","callType":"Method","data":"{}","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:kotlinx.rpc.SamplingServiceClient.CallException_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"callException","callType":"Method","data":"{}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallException","callId":"1:kotlinx.rpc.SamplingServiceClient.CallException_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":null,"className":"java.lang.IllegalStateException"},"connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:kotlinx.rpc.SamplingServiceClient.CallException_RPCData:1"}} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallException","callId":"1:kotlinx.rpc.SamplingServiceClient.CallException_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":null,"className":"java.lang.IllegalStateException"},"connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:kotlinx.rpc.SamplingServiceClient.CallException_RPCData:1"}} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_1/echo_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_1/echo_json.gold deleted file mode 100644 index 346ffb89..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_1/echo_json.gold +++ /dev/null @@ -1,9 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"echo","callType":"Method","data":"{\"arg1\":\"Hello\",\"data\":{\"data\":\"data\"}}","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"echo","callType":"Method","data":"{\"arg1\":\"Hello\",\"data\":{\"data\":\"data\"}}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1"}} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_1/echo_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_1/echo_protobuf.gold deleted file mode 100644 index a178c55a..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_1/echo_protobuf.gold +++ /dev/null @@ -1,18 +0,0 @@ -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Client] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Server] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????21:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??echo ?*???Hello????data0?8? -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791283010a32313a6b6f746c696e782e7270632e53616d706c696e6753657276696365436c69656e742e4563686f5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a046563686f20002a0f0a0548656c6c6f12060a046461746130013801 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????21:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??echo ?*???Hello????data0?8? -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791283010a32313a6b6f746c696e782e7270632e53616d706c696e6753657276696365436c69656e742e4563686f5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a046563686f20002a0f0a0548656c6c6f12060a046461746130013801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?r?21:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService????data ?(? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912720a32313a6b6f746c696e782e7270632e53616d706c696e6753657276696365436c69656e742e4563686f5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a060a046461746120012801 -// decoded: ?7org.jetbrains.krpc.internal.transport.RPCGenericMessage?{???????????????cancellation???????????????CANCELLATION_ACK??????????????21:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1 -[Server] [Send] $ 0a376f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504347656e657269634d657373616765127b1219088180feffffffffffff01120c63616e63656c6c6174696f6e121d088280feffffffffffff01121043414e43454c4c4154494f4e5f41434b123f088380feffffffffffff011232313a6b6f746c696e782e7270632e53616d706c696e6753657276696365436c69656e742e4563686f5f525043446174613a31 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?r?21:kotlinx.rpc.SamplingServiceClient.Echo_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService????data ?(? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912720a32313a6b6f746c696e782e7270632e53616d706c696e6753657276696365436c69656e742e4563686f5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a060a046461746120012801 \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_3/callException_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_3/callException_json.gold deleted file mode 100644 index 3950cea9..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_3/callException_json.gold +++ /dev/null @@ -1,10 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`callException$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"callException","callType":"Method","data":"{}","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`callException$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"callException","callType":"Method","data":"{}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallException","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`callException$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":null,"className":"java.lang.IllegalStateException"},"connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`callException$rpcMethod`:1"}} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallException","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`callException$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":null,"className":"java.lang.IllegalStateException"},"connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`callException$rpcMethod`:1"}} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_3/echo_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_3/echo_json.gold deleted file mode 100644 index 572d659f..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_3/echo_json.gold +++ /dev/null @@ -1,10 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766]} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766],"connectionId":1} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"echo","callType":"Method","data":"{\"arg1\":\"Hello\",\"data\":{\"data\":\"data\"}}","connectionId":1,"serviceId":1} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"echo","callType":"Method","data":"{\"arg1\":\"Hello\",\"data\":{\"data\":\"data\"}}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1"}} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1"}} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_3/echo_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_3/echo_protobuf.gold deleted file mode 100644 index 7e5144b5..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_2_3/echo_protobuf.gold +++ /dev/null @@ -1,20 +0,0 @@ -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Client] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake???????????????????????? -[Server] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651216088180feffffffffffff01088280feffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?????????????????????????? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b651218088180feffffffffffff01088280feffffffffffff011001 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????W1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1?0org.jetbrains.krpc.test.api.util.SamplingService??echo ?*???Hello????data0?8? -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e61727912a8010a57313a6f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963652e60247270635365727669636553747562602e606563686f247270634d6574686f64603a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a046563686f20002a0f0a0548656c6c6f12060a046461746130013801 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????W1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1?0org.jetbrains.krpc.test.api.util.SamplingService??echo ?*???Hello????data0?8? -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e61727912a8010a57313a6f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963652e60247270635365727669636553747562602e606563686f247270634d6574686f64603a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a046563686f20002a0f0a0548656c6c6f12060a046461746130013801 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary????W1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1?0org.jetbrains.krpc.test.api.util.SamplingService????data ?(? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e6172791297010a57313a6f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963652e60247270635365727669636553747562602e606563686f247270634d6574686f64603a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a060a046461746120012801 -// decoded: ?7org.jetbrains.krpc.internal.transport.RPCGenericMessage??????????????????cancellation???????????????CANCELLATION_ACK?d????????????W1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1 -[Server] [Send] $ 0a376f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504347656e657269634d65737361676512a0011219088180feffffffffffff01120c63616e63656c6c6174696f6e121d088280feffffffffffff01121043414e43454c4c4154494f4e5f41434b1264088380feffffffffffff011257313a6f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963652e60247270635365727669636553747562602e606563686f247270634d6574686f64603a31 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary????W1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1?0org.jetbrains.krpc.test.api.util.SamplingService????data ?(? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e6172791297010a57313a6f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963652e60247270635365727669636553747562602e606563686f247270634d6574686f64603a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a060a046461746120012801 -// decoded: ?7org.jetbrains.krpc.internal.transport.RPCGenericMessage??????????????????cancellation???????????????CANCELLATION_ACK?d????????????W1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1 -[Client] [Receive] $ 0a376f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504347656e657269634d65737361676512a0011219088180feffffffffffff01120c63616e63656c6c6174696f6e121d088280feffffffffffff01121043414e43454c4c4154494f4e5f41434b1264088380feffffffffffff011257313a6f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963652e60247270635365727669636553747562602e606563686f247270634d6574686f64603a31 \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_4_0/callException_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_4_0/callException_json.gold index 44dd288b..286a96bf 100644 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_4_0/callException_json.gold +++ b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_4_0/callException_json.gold @@ -5,6 +5,5 @@ [Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`callException$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"callException","callType":"Method","data":"{}","connectionId":1,"serviceId":1} [Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`callException$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"callException","callType":"Method","data":"{}","connectionId":1,"serviceId":1} [Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallException","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`callException$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":null,"className":"java.lang.IllegalStateException"},"className":"java.lang.IllegalStateException"},"connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`callException$rpcMethod`:1"}} [Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallException","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`callException$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":null,"className":"java.lang.IllegalStateException"},"className":"java.lang.IllegalStateException"},"connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`callException$rpcMethod`:1"}} \ No newline at end of file +[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`callException$rpcMethod`:1"}} diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_4_0/echo_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_4_0/echo_json.gold index 572d659f..3c863753 100644 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_4_0/echo_json.gold +++ b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_4_0/echo_json.gold @@ -5,6 +5,5 @@ [Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"echo","callType":"Method","data":"{\"arg1\":\"Hello\",\"data\":{\"data\":\"data\"}}","connectionId":1,"serviceId":1} [Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"echo","callType":"Method","data":"{\"arg1\":\"Hello\",\"data\":{\"data\":\"data\"}}","connectionId":1,"serviceId":1} [Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1"}} [Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1"}} \ No newline at end of file +[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1"}} diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_4_0/echo_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_4_0/echo_protobuf.gold index 7e5144b5..3d481f5b 100644 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_4_0/echo_protobuf.gold +++ b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_4_0/echo_protobuf.gold @@ -12,9 +12,7 @@ [Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e61727912a8010a57313a6f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963652e60247270635365727669636553747562602e606563686f247270634d6574686f64603a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a046563686f20002a0f0a0548656c6c6f12060a046461746130013801 // decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary????W1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1?0org.jetbrains.krpc.test.api.util.SamplingService????data ?(? [Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e6172791297010a57313a6f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963652e60247270635365727669636553747562602e606563686f247270634d6574686f64603a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a060a046461746120012801 -// decoded: ?7org.jetbrains.krpc.internal.transport.RPCGenericMessage??????????????????cancellation???????????????CANCELLATION_ACK?d????????????W1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1 -[Server] [Send] $ 0a376f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504347656e657269634d65737361676512a0011219088180feffffffffffff01120c63616e63656c6c6174696f6e121d088280feffffffffffff01121043414e43454c4c4154494f4e5f41434b1264088380feffffffffffff011257313a6f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963652e60247270635365727669636553747562602e606563686f247270634d6574686f64603a31 // decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary????W1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1?0org.jetbrains.krpc.test.api.util.SamplingService????data ?(? [Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e6172791297010a57313a6f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963652e60247270635365727669636553747562602e606563686f247270634d6574686f64603a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a060a046461746120012801 // decoded: ?7org.jetbrains.krpc.internal.transport.RPCGenericMessage??????????????????cancellation???????????????CANCELLATION_ACK?d????????????W1:org.jetbrains.krpc.test.api.util.SamplingService.`$rpcServiceStub`.`echo$rpcMethod`:1 -[Client] [Receive] $ 0a376f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504347656e657269634d65737361676512a0011219088180feffffffffffff01120c63616e63656c6c6174696f6e121d088280feffffffffffff01121043414e43454c4c4154494f4e5f41434b1264088380feffffffffffff011257313a6f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963652e60247270635365727669636553747562602e606563686f247270634d6574686f64603a31 \ No newline at end of file +[Client] [Receive] $ 0a376f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504347656e657269634d65737361676512a0011219088180feffffffffffff01120c63616e63656c6c6174696f6e121d088280feffffffffffff01121043414e43454c4c4154494f4e5f41434b1264088380feffffffffffff011257313a6f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963652e60247270635365727669636553747562602e606563686f247270634d6574686f64603a31 diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_6_0/callException_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_6_0/callException_json.gold index 8a3ceff5..3d7fa87f 100644 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_6_0/callException_json.gold +++ b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_6_0/callException_json.gold @@ -5,6 +5,5 @@ [Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:callException:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"callException","callType":"Method","data":"{}","connectionId":1,"serviceId":1} [Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:callException:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"callException","callType":"Method","data":"{}","connectionId":1,"serviceId":1} [Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallException","callId":"1:callException:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":null,"className":"java.lang.IllegalStateException"},"className":"java.lang.IllegalStateException"},"connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:callException:1"}} [Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallException","callId":"1:callException:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":null,"className":"java.lang.IllegalStateException"},"className":"java.lang.IllegalStateException"},"connectionId":1,"serviceId":1} [Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:callException:1"}} diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_6_0/echo_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_6_0/echo_json.gold index 37c083ac..e8d34906 100644 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_6_0/echo_json.gold +++ b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_6_0/echo_json.gold @@ -5,6 +5,5 @@ [Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:echo:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"echo","callType":"Method","data":"{\"arg1\":\"Hello\",\"data\":{\"data\":\"data\"}}","connectionId":1,"serviceId":1} [Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:echo:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"echo","callType":"Method","data":"{\"arg1\":\"Hello\",\"data\":{\"data\":\"data\"}}","connectionId":1,"serviceId":1} [Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:echo:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} -[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:echo:1"}} [Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:echo:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} [Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"CANCELLATION_ACK","-32765":"1:echo:1"}} diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_6_0/echo_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_6_0/echo_protobuf.gold index d52bc3ab..78db12d3 100644 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_6_0/echo_protobuf.gold +++ b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_6_0/echo_protobuf.gold @@ -12,8 +12,6 @@ [Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e61727912590a08313a6563686f3a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a046563686f20002a0f0a0548656c6c6f12060a046461746130013801 // decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?H??1:echo:1?0org.jetbrains.krpc.test.api.util.SamplingService????data ?(? [Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912480a08313a6563686f3a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a060a046461746120012801 -// decoded: ?7org.jetbrains.krpc.internal.transport.RPCGenericMessage?Q???????????????cancellation???????????????CANCELLATION_ACK???????????????1:echo:1 -[Server] [Send] $ 0a376f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504347656e657269634d65737361676512511219088180feffffffffffff01120c63616e63656c6c6174696f6e121d088280feffffffffffff01121043414e43454c4c4154494f4e5f41434b1215088380feffffffffffff011208313a6563686f3a31 // decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?H??1:echo:1?0org.jetbrains.krpc.test.api.util.SamplingService????data ?(? [Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912480a08313a6563686f3a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a060a046461746120012801 // decoded: ?7org.jetbrains.krpc.internal.transport.RPCGenericMessage?Q???????????????cancellation???????????????CANCELLATION_ACK???????????????1:echo:1 diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_8_0/callException_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_8_0/callException_json.gold new file mode 100644 index 00000000..c9c382ff --- /dev/null +++ b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_8_0/callException_json.gold @@ -0,0 +1,8 @@ +[Client] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766,-32765,-32764]} +[Server] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766,-32765,-32764]} +[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766,-32765,-32764],"connectionId":1} +[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766,-32765,-32764],"connectionId":1} +[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:callException:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"callException","callType":"Method","data":"{}","connectionId":1,"serviceId":1,"pluginParams":{"-32763":""}} +[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:callException:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"callException","callType":"Method","data":"{}","connectionId":1,"serviceId":1,"pluginParams":{"-32763":""}} +[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallException","callId":"1:callException:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":null,"className":"java.lang.IllegalStateException"},"connectionId":1,"serviceId":1} +[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallException","callId":"1:callException:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":null,"className":"java.lang.IllegalStateException"},"connectionId":1,"serviceId":1} diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_8_0/echo_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_8_0/echo_json.gold new file mode 100644 index 00000000..7f68cc99 --- /dev/null +++ b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_8_0/echo_json.gold @@ -0,0 +1,10 @@ +[Client] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766,-32765,-32764]} +[Server] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766,-32765,-32764]} +[Server] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766,-32765,-32764],"connectionId":1} +[Client] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake","supportedPlugins":[-32767,-32766,-32765,-32764],"connectionId":1} +[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:echo:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"echo","callType":"Method","data":"{\"arg1\":\"Hello\",\"data\":{\"data\":\"data\"}}","connectionId":1,"serviceId":1,"pluginParams":{"-32763":""}} +[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:echo:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"echo","callType":"Method","data":"{\"arg1\":\"Hello\",\"data\":{\"data\":\"data\"}}","connectionId":1,"serviceId":1,"pluginParams":{"-32763":""}} +[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:echo:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} +[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:echo:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{\"data\":\"data\"}","connectionId":1,"serviceId":1} +[Client] [Send] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"REQUEST","-32764":"org.jetbrains.krpc.test.api.util.SamplingService","-32765":"1:echo:1"}} +[Server] [Receive] $ {"type":"org.jetbrains.krpc.internal.transport.RPCGenericMessage","connectionId":null,"pluginParams":{"-32767":"cancellation","-32766":"REQUEST","-32764":"org.jetbrains.krpc.test.api.util.SamplingService","-32765":"1:echo:1"}} diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_8_0/echo_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_8_0/echo_protobuf.gold new file mode 100644 index 00000000..bc482160 --- /dev/null +++ b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/0_8_0/echo_protobuf.gold @@ -0,0 +1,20 @@ +// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?,???????????????????????????????????????????? +[Client] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b65122c088180feffffffffffff01088280feffffffffffff01088380feffffffffffff01088480feffffffffffff01 +// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?,???????????????????????????????????????????? +[Server] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b65122c088180feffffffffffff01088280feffffffffffff01088380feffffffffffff01088480feffffffffffff01 +// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?.?????????????????????????????????????????????? +[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b65122e088180feffffffffffff01088280feffffffffffff01088380feffffffffffff01088480feffffffffffff011001 +// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCProtocolMessage.Handshake?.?????????????????????????????????????????????? +[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504350726f746f636f6c4d6573736167652e48616e647368616b65122e088180feffffffffffff01088280feffffffffffff01088380feffffffffffff01088480feffffffffffff011001 +// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?h??1:echo:1?0org.jetbrains.krpc.test.api.util.SamplingService??echo ?*???Hello????data0?8?B?????????????? +[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e61727912680a08313a6563686f3a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a046563686f20002a0f0a0548656c6c6f12060a046461746130013801420d088580feffffffffffff011200 +// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?h??1:echo:1?0org.jetbrains.krpc.test.api.util.SamplingService??echo ?*???Hello????data0?8?B?????????????? +[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e61727912680a08313a6563686f3a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a046563686f20002a0f0a0548656c6c6f12060a046461746130013801420d088580feffffffffffff011200 +// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?H??1:echo:1?0org.jetbrains.krpc.test.api.util.SamplingService????data ?(? +[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912480a08313a6563686f3a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a060a046461746120012801 +// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?H??1:echo:1?0org.jetbrains.krpc.test.api.util.SamplingService????data ?(? +[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912480a08313a6563686f3a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a060a046461746120012801 +// decoded: ?7org.jetbrains.krpc.internal.transport.RPCGenericMessage??????????????????cancellation???????????????REQUEST?=????????????0org.jetbrains.krpc.test.api.util.SamplingService???????????????1:echo:1 +[Client] [Send] $ 0a376f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504347656e657269634d6573736167651287011219088180feffffffffffff01120c63616e63656c6c6174696f6e1214088280feffffffffffff01120752455155455354123d088480feffffffffffff0112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651215088380feffffffffffff011208313a6563686f3a31 +// decoded: ?7org.jetbrains.krpc.internal.transport.RPCGenericMessage??????????????????cancellation???????????????REQUEST?=????????????0org.jetbrains.krpc.test.api.util.SamplingService???????????????1:echo:1 +[Server] [Receive] $ 0a376f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e52504347656e657269634d6573736167651287011219088180feffffffffffff01120c63616e63656c6c6174696f6e1214088280feffffffffffff01120752455155455354123d088480feffffffffffff0112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651215088380feffffffffffff011208313a6563686f3a31 diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/callException_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/callException_json.gold deleted file mode 100644 index 309ea7e0..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/callException_json.gold +++ /dev/null @@ -1,4 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.CallException_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"callException","callType":"Method","data":"{}"} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.CallException_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"callException","callType":"Method","data":"{}"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallException","callId":"1:org.jetbrains.krpc.SamplingServiceClient.CallException_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":null,"className":"java.lang.IllegalStateException"}} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallException","callId":"1:org.jetbrains.krpc.SamplingServiceClient.CallException_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","cause":{"toStringMessage":"java.lang.IllegalStateException: Server exception","message":"Server exception","stacktrace":[],"cause":null,"className":"java.lang.IllegalStateException"}} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/clientStream_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/clientStream_json.gold deleted file mode 100644 index 6e7104fc..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/clientStream_json.gold +++ /dev/null @@ -1,16 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"clientStream","callType":"Method","data":"{\"flow\":\"stream:0\"}"} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"clientStream","callType":"Method","data":"{\"flow\":\"stream:0\"}"} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"0"} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"1"} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"0"} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"1"} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"2"} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"3"} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"2"} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"3"} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"4"} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamFinished","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0"} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"4"} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamFinished","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"[0,1,2,3,4]"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"[0,1,2,3,4]"} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/clientStream_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/clientStream_protobuf.gold deleted file mode 100644 index ed240998..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/clientStream_protobuf.gold +++ /dev/null @@ -1,32 +0,0 @@ -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??clientStream ?*???stream:0 -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791291010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0c636c69656e7453747265616d20002a0a0a0873747265616d3a30 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??clientStream ?*???stream:0 -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791291010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0c636c69656e7453747265616d20002a0a0a0873747265616d3a30 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791282010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220100 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791282010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220101 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791282010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220100 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791282010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220101 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791282010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220102 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791282010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220103 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791282010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220102 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791282010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220103 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791282010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220104 -// decoded: ?,org.jetbrains.krpc.RPCMessage.StreamFinished???A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0 -[Client] [Send] $ 0a2c6f72672e6a6574627261696e732e6b7270632e5250434d6573736167652e53747265616d46696e6973686564127f0a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791282010a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220104 -// decoded: ?,org.jetbrains.krpc.RPCMessage.StreamFinished???A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0 -[Server] [Receive] $ 0a2c6f72672e6a6574627261696e732e6b7270632e5250434d6573736167652e53747265616d46696e6973686564127f0a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?}?A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService???????? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e617279127d0a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a06050001020304 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?}?A1:org.jetbrains.krpc.SamplingServiceClient.ClientStream_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService???????? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e617279127d0a41313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e436c69656e7453747265616d5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a06050001020304 \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/echo_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/echo_json.gold deleted file mode 100644 index 9615c918..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/echo_json.gold +++ /dev/null @@ -1,4 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.Echo_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"echo","callType":"Method","data":"{\"arg1\":\"Hello\",\"data\":{\"data\":\"data\"}}"} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.Echo_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"echo","callType":"Method","data":"{\"arg1\":\"Hello\",\"data\":{\"data\":\"data\"}}"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.SamplingServiceClient.Echo_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{\"data\":\"data\"}"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.SamplingServiceClient.Echo_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{\"data\":\"data\"}"} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/echo_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/echo_protobuf.gold deleted file mode 100644 index 1e53265a..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/echo_protobuf.gold +++ /dev/null @@ -1,8 +0,0 @@ -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????91:org.jetbrains.krpc.SamplingServiceClient.Echo_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??echo ?*???Hello????data -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791286010a39313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e4563686f5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a046563686f20002a0f0a0548656c6c6f12060a0464617461 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????91:org.jetbrains.krpc.SamplingServiceClient.Echo_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??echo ?*???Hello????data -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791286010a39313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e4563686f5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a046563686f20002a0f0a0548656c6c6f12060a0464617461 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?u?91:org.jetbrains.krpc.SamplingServiceClient.Echo_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService????data -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912750a39313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e4563686f5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a060a0464617461 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?u?91:org.jetbrains.krpc.SamplingServiceClient.Echo_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService????data -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912750a39313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e4563686f5f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a060a0464617461 \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/plainFlow_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/plainFlow_json.gold deleted file mode 100644 index 2c76fb0f..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/plainFlow_json.gold +++ /dev/null @@ -1,16 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"plainFlow","callType":"Field","data":"{}"} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"plainFlow","callType":"Field","data":"{}"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\""} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\""} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"0"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"1"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"0"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"1"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"2"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"3"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"2"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"3"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"4"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamFinished","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"4"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamFinished","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0"} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/plainFlow_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/plainFlow_protobuf.gold deleted file mode 100644 index 7df170b8..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/plainFlow_protobuf.gold +++ /dev/null @@ -1,32 +0,0 @@ -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?y?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??plainFlow ?*? -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e61727912790a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a09706c61696e466c6f7720012a00 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?y?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??plainFlow ?*? -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e61727912790a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a09706c61696e466c6f7720012a00 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?u?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0 -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912750a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a090873747265616d3a30 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?u?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0 -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912750a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a090873747265616d3a30 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220100 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220101 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220100 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220101 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220102 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220103 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220102 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220103 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220104 -// decoded: ?,org.jetbrains.krpc.RPCMessage.StreamFinished?t?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0 -[Server] [Send] $ 0a2c6f72672e6a6574627261696e732e6b7270632e5250434d6573736167652e53747265616d46696e697368656412740a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220104 -// decoded: ?,org.jetbrains.krpc.RPCMessage.StreamFinished?t?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0 -[Client] [Receive] $ 0a2c6f72672e6a6574627261696e732e6b7270632e5250434d6573736167652e53747265616d46696e697368656412740a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30 \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/serverStream_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/serverStream_json.gold deleted file mode 100644 index 9b72d37d..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/serverStream_json.gold +++ /dev/null @@ -1,16 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"serverFlow","callType":"Method","data":"{}"} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"serverFlow","callType":"Method","data":"{}"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\""} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\""} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamFinished","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"{\"data\":\"data\"}"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamFinished","callId":"1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0"} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/serverStream_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/serverStream_protobuf.gold deleted file mode 100644 index bc0fed99..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/serverStream_protobuf.gold +++ /dev/null @@ -1,32 +0,0 @@ -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??serverFlow ?*? -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791283010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0a736572766572466c6f7720002a00 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??serverFlow ?*? -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791283010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0a736572766572466c6f7720002a00 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?~??1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0 -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e617279127e0a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a090873747265616d3a30 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?~??1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0 -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e617279127e0a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a090873747265616d3a30 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791285010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a0464617461 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791285010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a0464617461 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791285010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a0464617461 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791285010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a0464617461 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791285010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a0464617461 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791285010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a0464617461 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791285010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a0464617461 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791285010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a0464617461 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791285010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a0464617461 -// decoded: ?,org.jetbrains.krpc.RPCMessage.StreamFinished?}??1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0 -[Server] [Send] $ 0a2c6f72672e6a6574627261696e732e6b7270632e5250434d6573736167652e53747265616d46696e6973686564127d0a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?????1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"???data -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791285010a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022060a0464617461 -// decoded: ?,org.jetbrains.krpc.RPCMessage.StreamFinished?}??1:org.jetbrains.krpc.SamplingServiceClient.ServerFlow_RPCData:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0 -[Client] [Receive] $ 0a2c6f72672e6a6574627261696e732e6b7270632e5250434d6573736167652e53747265616d46696e6973686564127d0a3f313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e536572766572466c6f775f525043446174613a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30 \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/sharedFlow_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/sharedFlow_json.gold deleted file mode 100644 index 7bd94f78..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/sharedFlow_json.gold +++ /dev/null @@ -1,14 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"sharedFlow","callType":"Field","data":"{}"} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"sharedFlow","callType":"Field","data":"{}"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\""} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\""} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"0"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"1"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"0"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"1"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"2"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"3"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"2"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"3"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"4"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"4"} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/sharedFlow_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/sharedFlow_protobuf.gold deleted file mode 100644 index c147a170..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/sharedFlow_protobuf.gold +++ /dev/null @@ -1,28 +0,0 @@ -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?z?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??sharedFlow ?*? -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e617279127a0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0a736861726564466c6f7720012a00 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?z?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??sharedFlow ?*? -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e617279127a0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0a736861726564466c6f7720012a00 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?u?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0 -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912750a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a090873747265616d3a30 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?u?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0 -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e61727912750a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a090873747265616d3a30 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220100 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220101 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220100 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220101 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220102 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220103 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220102 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220103 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220104 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220104 \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/stateFlow_json.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/stateFlow_json.gold deleted file mode 100644 index 4ca6bbe1..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/stateFlow_json.gold +++ /dev/null @@ -1,12 +0,0 @@ -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"stateFlow","callType":"Field","data":"{}"} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"stateFlow","callType":"Field","data":"{}"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\"-1"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"\"stream:0\"-1"} -[Client] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"emitNextInStateFlow","callType":"Method","data":"{\"next\":10}"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"-1"} -[Server] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallData","callId":"1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","method":"emitNextInStateFlow","callType":"Method","data":"{\"next\":10}"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"-1"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{}"} -[Server] [Send] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"10"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.CallSuccess","callId":"1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","data":"{}"} -[Client] [Receive] $ {"type":"org.jetbrains.krpc.RPCMessage.StreamMessage","callId":"1:org.jetbrains.krpc.client.internal.FieldDataObject:1","serviceType":"org.jetbrains.krpc.test.api.util.SamplingService","flowId":"stream:0","data":"10"} \ No newline at end of file diff --git a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/stateFlow_protobuf.gold b/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/stateFlow_protobuf.gold deleted file mode 100644 index b8bf0397..00000000 --- a/krpc/krpc-test/src/jvmTest/resources/wire_dumps/5_3_beta/stateFlow_protobuf.gold +++ /dev/null @@ -1,24 +0,0 @@ -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?y?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stateFlow ?*? -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e61727912790a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a097374617465466c6f7720012a00 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary?y?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stateFlow ?*? -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e61727912790a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a097374617465466c6f7720012a00 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary???61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0?????????? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e617279127f0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a130873747265616d3a30ffffffffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary???61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService???stream:0?????????? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e617279127f0a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a130873747265616d3a30ffffffffffffffffff01 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????H1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2?0org.jetbrains.krpc.test.api.util.SamplingService??emitNextInStateFlow ?*??? -[Client] [Send] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791297010a48313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e456d69744e657874496e5374617465466c6f775f525043446174613a3212306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a13656d69744e657874496e5374617465466c6f7720002a02080a -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??????????? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791280010a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220affffffffffffffffff01 -// decoded: ??org.jetbrains.krpc.internal.transport.RPCMessage.CallDataBinary????H1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2?0org.jetbrains.krpc.test.api.util.SamplingService??emitNextInStateFlow ?*??? -[Server] [Receive] $ 0a3f6f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c4461746142696e6172791297010a48313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e456d69744e657874496e5374617465466c6f775f525043446174613a3212306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a13656d69744e657874496e5374617465466c6f7720002a02080a -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary????61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"??????????? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e6172791280010a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a30220affffffffffffffffff01 -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?~?H1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2?0org.jetbrains.krpc.test.api.util.SamplingService?? -[Server] [Send] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e617279127e0a48313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e456d69744e657874496e5374617465466c6f775f525043446174613a3212306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a00 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Server] [Send] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010a -// decoded: ?Borg.jetbrains.krpc.internal.transport.RPCMessage.CallSuccessBinary?~?H1:org.jetbrains.krpc.SamplingServiceClient.EmitNextInStateFlow_RPCData:2?0org.jetbrains.krpc.test.api.util.SamplingService?? -[Client] [Receive] $ 0a426f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e43616c6c5375636365737342696e617279127e0a48313a6f72672e6a6574627261696e732e6b7270632e53616d706c696e6753657276696365436c69656e742e456d69744e657874496e5374617465466c6f775f525043446174613a3212306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a00 -// decoded: ?Dorg.jetbrains.krpc.internal.transport.RPCMessage.StreamMessageBinary?w?61:org.jetbrains.krpc.client.internal.FieldDataObject:1?0org.jetbrains.krpc.test.api.util.SamplingService??stream:0"?? -[Client] [Receive] $ 0a446f72672e6a6574627261696e732e6b7270632e696e7465726e616c2e7472616e73706f72742e5250434d6573736167652e53747265616d4d65737361676542696e61727912770a36313a6f72672e6a6574627261696e732e6b7270632e636c69656e742e696e7465726e616c2e4669656c64446174614f626a6563743a3112306f72672e6a6574627261696e732e6b7270632e746573742e6170692e7574696c2e53616d706c696e67536572766963651a0873747265616d3a3022010a \ No newline at end of file diff --git a/krpc/krpc-test/src/nativeMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.native.kt b/krpc/krpc-test/src/nativeMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.native.kt index 64bbe3ee..4d4073c7 100644 --- a/krpc/krpc-test/src/nativeMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.native.kt +++ b/krpc/krpc-test/src/nativeMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.native.kt @@ -4,7 +4,7 @@ package kotlinx.rpc.krpc.test -import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.test.TestScope import kotlin.native.concurrent.ObsoleteWorkersApi import kotlin.native.concurrent.Worker @@ -13,5 +13,6 @@ actual fun runThreadIfPossible(runner: () -> Unit) { Worker.start(errorReporting = true).executeAfter(0L, runner) } -internal actual fun CoroutineScope.debugCoroutines() { +@Suppress("detekt.EmptyFunctionBlock") +internal actual fun TestScope.debugCoroutines() { } diff --git a/krpc/krpc-test/src/wasmJsMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.wasmJs.kt b/krpc/krpc-test/src/wasmJsMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.wasmJs.kt index 79eaba18..84b7631c 100644 --- a/krpc/krpc-test/src/wasmJsMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.wasmJs.kt +++ b/krpc/krpc-test/src/wasmJsMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.wasmJs.kt @@ -4,11 +4,11 @@ package kotlinx.rpc.krpc.test -import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.test.TestScope actual inline fun runThreadIfPossible(runner: () -> Unit) { runner() } -internal actual fun CoroutineScope.debugCoroutines() { +internal actual fun TestScope.debugCoroutines() { } diff --git a/tests/compiler-plugin-tests/src/main/kotlin/kotlinx/rpc/codegen/test/TestRpcClient.kt b/tests/compiler-plugin-tests/src/main/kotlin/kotlinx/rpc/codegen/test/TestRpcClient.kt index 86bd99bb..0fd640cd 100644 --- a/tests/compiler-plugin-tests/src/main/kotlin/kotlinx/rpc/codegen/test/TestRpcClient.kt +++ b/tests/compiler-plugin-tests/src/main/kotlin/kotlinx/rpc/codegen/test/TestRpcClient.kt @@ -22,8 +22,4 @@ object TestRpcClient : RpcClient { override fun callServerStreaming(call: RpcCall): Flow { return flow { emit("stream_42" as T) } } - - override fun provideStubContext(serviceId: Long): CoroutineContext { - return coroutineContext - } } diff --git a/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.ir.txt b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.ir.txt index 99523dc3..f3c05f89 100644 --- a/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.ir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.ir.txt @@ -311,7 +311,7 @@ FILE fqName: fileName:/customParameterTypes.kt index: CONST Int type=kotlin.Int value=0 value: CALL 'public final fun (): kotlin.String declared in .TestData' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR 'self: .TestData declared in .TestData.write$Self' type=.TestData origin=null - CLASS INTERFACE name:BoxService modality:ABSTRACT visibility:public superTypes:[kotlinx.rpc.RemoteService] + CLASS INTERFACE name:BoxService modality:ABSTRACT visibility:public superTypes:[kotlin.Any] annotations: Rpc $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService @@ -339,25 +339,6 @@ FILE fqName: fileName:/customParameterTypes.kt RETURN type=kotlin.Nothing from='private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RpcClient visibility:private [final]' type=kotlinx.rpc.RpcClient origin=null receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null - PROPERTY name:coroutineContext visibility:public modality:FINAL [val] - overridden: - public abstract coroutineContext: kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RpcClient - FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final] - EXPRESSION_BODY - CALL 'public abstract fun provideStubContext (serviceId: kotlin.Long): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RpcClient' type=kotlin.coroutines.CoroutineContext origin=null - $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.coroutines.CoroutineContext - correspondingProperty: PROPERTY name:coroutineContext visibility:public modality:FINAL [val] - overridden: - public abstract fun (): kotlin.coroutines.CoroutineContext declared in .BoxService - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.coroutines.CoroutineContext declared in .BoxService.$rpcServiceStub' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final]' type=kotlin.coroutines.CoroutineContext origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.Companion PROPERTY name:fqName visibility:public modality:FINAL [val] @@ -1112,24 +1093,17 @@ FILE fqName: fileName:/customParameterTypes.kt VALUE_PARAMETER name:testData index:0 type:.TestData BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun test1 (testData: .TestData): kotlin.String declared in .BoxService.$rpcServiceStub' - CALL 'public final fun scopedClientCall (serviceScope: kotlinx.coroutines.CoroutineScope, body: kotlin.coroutines.SuspendFunction0): T of kotlinx.rpc.internal.scopedClientCall declared in kotlinx.rpc.internal' type=kotlin.String origin=null + CALL 'public abstract fun call (call: kotlinx.rpc.RpcCall): T of kotlinx.rpc.RpcClient.call declared in kotlinx.rpc.RpcClient' type=kotlin.String origin=null : kotlin.String - serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test1' type=kotlinx.coroutines.CoroutineScope origin=null - body: FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String [suspend] - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .BoxService.$rpcServiceStub.test1' - CALL 'public abstract fun call (call: kotlinx.rpc.RpcCall): T of kotlinx.rpc.RpcClient.call declared in kotlinx.rpc.RpcClient' type=kotlin.String origin=null - : kotlin.String - $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test1' type=.BoxService.$rpcServiceStub origin=null - call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null - descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion - callableName: CONST String type=kotlin.String value="test1" - data: CONSTRUCTOR_CALL 'public constructor (testData: .TestData) declared in .BoxService.$rpcServiceStub.test1$rpcMethod' type=.BoxService.$rpcServiceStub.test1$rpcMethod origin=null - testData: GET_VAR 'testData: .TestData declared in .BoxService.$rpcServiceStub.test1' type=.TestData origin=null - serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test1' type=.BoxService.$rpcServiceStub origin=null + $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test1' type=.BoxService.$rpcServiceStub origin=null + call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null + descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion + callableName: CONST String type=kotlin.String value="test1" + data: CONSTRUCTOR_CALL 'public constructor (testData: .TestData) declared in .BoxService.$rpcServiceStub.test1$rpcMethod' type=.BoxService.$rpcServiceStub.test1$rpcMethod origin=null + testData: GET_VAR 'testData: .TestData declared in .BoxService.$rpcServiceStub.test1' type=.TestData origin=null + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test1' type=.BoxService.$rpcServiceStub origin=null FUN name:test2 visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub, testData:.TestData) returnType:kotlin.String [suspend] overridden: public abstract fun test2 (testData: .TestData): kotlin.String declared in .BoxService @@ -1137,36 +1111,29 @@ FILE fqName: fileName:/customParameterTypes.kt VALUE_PARAMETER name:testData index:0 type:.TestData BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun test2 (testData: .TestData): kotlin.String declared in .BoxService.$rpcServiceStub' - CALL 'public final fun scopedClientCall (serviceScope: kotlinx.coroutines.CoroutineScope, body: kotlin.coroutines.SuspendFunction0): T of kotlinx.rpc.internal.scopedClientCall declared in kotlinx.rpc.internal' type=kotlin.String origin=null + CALL 'public abstract fun call (call: kotlinx.rpc.RpcCall): T of kotlinx.rpc.RpcClient.call declared in kotlinx.rpc.RpcClient' type=kotlin.String origin=null : kotlin.String - serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test2' type=kotlinx.coroutines.CoroutineScope origin=null - body: FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String [suspend] - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .BoxService.$rpcServiceStub.test2' - CALL 'public abstract fun call (call: kotlinx.rpc.RpcCall): T of kotlinx.rpc.RpcClient.call declared in kotlinx.rpc.RpcClient' type=kotlin.String origin=null - : kotlin.String - $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test2' type=.BoxService.$rpcServiceStub origin=null - call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null - descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion - callableName: CONST String type=kotlin.String value="test2" - data: CONSTRUCTOR_CALL 'public constructor (testData: .TestData) declared in .BoxService.$rpcServiceStub.test2$rpcMethod' type=.BoxService.$rpcServiceStub.test2$rpcMethod origin=null - testData: GET_VAR 'testData: .TestData declared in .BoxService.$rpcServiceStub.test2' type=.TestData origin=null - serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test2' type=.BoxService.$rpcServiceStub origin=null + $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test2' type=.BoxService.$rpcServiceStub origin=null + call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null + descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion + callableName: CONST String type=kotlin.String value="test2" + data: CONSTRUCTOR_CALL 'public constructor (testData: .TestData) declared in .BoxService.$rpcServiceStub.test2$rpcMethod' type=.BoxService.$rpcServiceStub.test2$rpcMethod origin=null + testData: GET_VAR 'testData: .TestData declared in .BoxService.$rpcServiceStub.test2' type=.TestData origin=null + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test2' type=.BoxService.$rpcServiceStub origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.RemoteService + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] overridden: - public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.RemoteService + public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] overridden: - public open fun toString (): kotlin.String declared in kotlinx.rpc.RemoteService + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:test1 visibility:public modality:ABSTRACT <> ($this:.BoxService, testData:.TestData) returnType:kotlin.String [suspend] $this: VALUE_PARAMETER name: type:.BoxService @@ -1174,14 +1141,6 @@ FILE fqName: fileName:/customParameterTypes.kt FUN name:test2 visibility:public modality:ABSTRACT <> ($this:.BoxService, testData:.TestData) returnType:kotlin.String [suspend] $this: VALUE_PARAMETER name: type:.BoxService VALUE_PARAMETER name:testData index:0 type:.TestData - PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract coroutineContext: kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RemoteService - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlinx.rpc.RemoteService) returnType:kotlin.coroutines.CoroutineContext [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RemoteService - $this: VALUE_PARAMETER name: type:kotlinx.rpc.RemoteService FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' diff --git a/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.txt b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.txt index 8f4220e9..75786404 100644 --- a/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.txt @@ -37,7 +37,7 @@ FILE: customParameterTypes.kt } } - @R|kotlinx/rpc/annotations/Rpc|() public abstract interface BoxService : R|kotlinx/rpc/RemoteService| { + @R|kotlinx/rpc/annotations/Rpc|() public abstract interface BoxService : R|kotlin/Any| { public abstract suspend fun test1(testData: R|TestData|): R|kotlin/String| public abstract suspend fun test2(testData: R|TestData|): R|kotlin/String| diff --git a/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.kt b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.kt index e8f0b547..ea977aaa 100644 --- a/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.kt +++ b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.kt @@ -5,7 +5,6 @@ import kotlinx.coroutines.flow.* import kotlinx.coroutines.runBlocking import kotlinx.serialization.Serializable -import kotlinx.rpc.RemoteService import kotlinx.rpc.withService import kotlinx.rpc.annotations.Rpc import kotlinx.rpc.codegen.test.TestRpcClient @@ -14,7 +13,7 @@ import kotlinx.rpc.codegen.test.TestRpcClient data class TestData(val value: String) @Rpc -interface BoxService : RemoteService { +interface BoxService { suspend fun test1(testData: TestData): String suspend fun test2(testData: TestData): String diff --git a/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.ir.txt b/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.ir.txt index 21fc1a54..c7131199 100644 --- a/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.ir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.ir.txt @@ -1,5 +1,5 @@ FILE fqName: fileName:/flowParameter.kt - CLASS INTERFACE name:BoxService modality:ABSTRACT visibility:public superTypes:[kotlinx.rpc.RemoteService] + CLASS INTERFACE name:BoxService modality:ABSTRACT visibility:public superTypes:[kotlin.Any] annotations: Rpc $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService @@ -27,25 +27,6 @@ FILE fqName: fileName:/flowParameter.kt RETURN type=kotlin.Nothing from='private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RpcClient visibility:private [final]' type=kotlinx.rpc.RpcClient origin=null receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null - PROPERTY name:coroutineContext visibility:public modality:FINAL [val] - overridden: - public abstract coroutineContext: kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RpcClient - FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final] - EXPRESSION_BODY - CALL 'public abstract fun provideStubContext (serviceId: kotlin.Long): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RpcClient' type=kotlin.coroutines.CoroutineContext origin=null - $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.coroutines.CoroutineContext - correspondingProperty: PROPERTY name:coroutineContext visibility:public modality:FINAL [val] - overridden: - public abstract fun (): kotlin.coroutines.CoroutineContext declared in .BoxService - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.coroutines.CoroutineContext declared in .BoxService.$rpcServiceStub' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final]' type=kotlin.coroutines.CoroutineContext origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.Companion PROPERTY name:fqName visibility:public modality:FINAL [val] @@ -525,48 +506,33 @@ FILE fqName: fileName:/flowParameter.kt VALUE_PARAMETER name:flow index:0 type:kotlinx.coroutines.flow.Flow BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun stream (flow: kotlinx.coroutines.flow.Flow): kotlin.String declared in .BoxService.$rpcServiceStub' - CALL 'public final fun scopedClientCall (serviceScope: kotlinx.coroutines.CoroutineScope, body: kotlin.coroutines.SuspendFunction0): T of kotlinx.rpc.internal.scopedClientCall declared in kotlinx.rpc.internal' type=kotlin.String origin=null + CALL 'public abstract fun call (call: kotlinx.rpc.RpcCall): T of kotlinx.rpc.RpcClient.call declared in kotlinx.rpc.RpcClient' type=kotlin.String origin=null : kotlin.String - serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.stream' type=kotlinx.coroutines.CoroutineScope origin=null - body: FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String [suspend] - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .BoxService.$rpcServiceStub.stream' - CALL 'public abstract fun call (call: kotlinx.rpc.RpcCall): T of kotlinx.rpc.RpcClient.call declared in kotlinx.rpc.RpcClient' type=kotlin.String origin=null - : kotlin.String - $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.stream' type=.BoxService.$rpcServiceStub origin=null - call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null - descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion - callableName: CONST String type=kotlin.String value="stream" - data: CONSTRUCTOR_CALL 'public constructor (flow: kotlinx.coroutines.flow.Flow) declared in .BoxService.$rpcServiceStub.stream$rpcMethod' type=.BoxService.$rpcServiceStub.stream$rpcMethod origin=null - flow: GET_VAR 'flow: kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub.stream' type=kotlinx.coroutines.flow.Flow origin=null - serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.stream' type=.BoxService.$rpcServiceStub origin=null + $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.stream' type=.BoxService.$rpcServiceStub origin=null + call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null + descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion + callableName: CONST String type=kotlin.String value="stream" + data: CONSTRUCTOR_CALL 'public constructor (flow: kotlinx.coroutines.flow.Flow) declared in .BoxService.$rpcServiceStub.stream$rpcMethod' type=.BoxService.$rpcServiceStub.stream$rpcMethod origin=null + flow: GET_VAR 'flow: kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub.stream' type=kotlinx.coroutines.flow.Flow origin=null + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.stream' type=.BoxService.$rpcServiceStub origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.RemoteService + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] overridden: - public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.RemoteService + public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] overridden: - public open fun toString (): kotlin.String declared in kotlinx.rpc.RemoteService + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:stream visibility:public modality:ABSTRACT <> ($this:.BoxService, flow:kotlinx.coroutines.flow.Flow) returnType:kotlin.String [suspend] $this: VALUE_PARAMETER name: type:.BoxService VALUE_PARAMETER name:flow index:0 type:kotlinx.coroutines.flow.Flow - PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract coroutineContext: kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RemoteService - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlinx.rpc.RemoteService) returnType:kotlin.coroutines.CoroutineContext [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RemoteService - $this: VALUE_PARAMETER name: type:kotlinx.rpc.RemoteService FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' diff --git a/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.txt b/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.txt index bbcf6fbd..faa22955 100644 --- a/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.txt @@ -1,5 +1,5 @@ FILE: flowParameter.kt - @R|kotlinx/rpc/annotations/Rpc|() public abstract interface BoxService : R|kotlinx/rpc/RemoteService| { + @R|kotlinx/rpc/annotations/Rpc|() public abstract interface BoxService : R|kotlin/Any| { public abstract suspend fun stream(flow: R|kotlinx/coroutines/flow/Flow|): R|kotlin/String| public final class $rpcServiceStub : R|kotlin/Any| { diff --git a/tests/compiler-plugin-tests/src/testData/box/flowParameter.kt b/tests/compiler-plugin-tests/src/testData/box/flowParameter.kt index bf1be1ab..054984b2 100644 --- a/tests/compiler-plugin-tests/src/testData/box/flowParameter.kt +++ b/tests/compiler-plugin-tests/src/testData/box/flowParameter.kt @@ -4,13 +4,12 @@ import kotlinx.coroutines.flow.* import kotlinx.coroutines.runBlocking -import kotlinx.rpc.RemoteService import kotlinx.rpc.withService import kotlinx.rpc.annotations.Rpc import kotlinx.rpc.codegen.test.TestRpcClient @Rpc -interface BoxService : RemoteService { +interface BoxService { // plugin should add @Contextual annotation to the flow parameter in the generated class suspend fun stream(flow: Flow): String } diff --git a/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.ir.txt b/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.ir.txt index b5f47934..6efbbd23 100644 --- a/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.ir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.ir.txt @@ -1,6 +1,6 @@ Module: lib FILE fqName: fileName:/module_lib_multiModule.kt - CLASS INTERFACE name:BoxService modality:ABSTRACT visibility:public superTypes:[kotlinx.rpc.RemoteService] + CLASS INTERFACE name:BoxService modality:ABSTRACT visibility:public superTypes:[kotlin.Any] annotations: Rpc $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService @@ -28,25 +28,6 @@ FILE fqName: fileName:/module_lib_multiModule.kt RETURN type=kotlin.Nothing from='private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RpcClient visibility:private [final]' type=kotlinx.rpc.RpcClient origin=null receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null - PROPERTY name:coroutineContext visibility:public modality:FINAL [val] - overridden: - public abstract coroutineContext: kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RpcClient - FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final] - EXPRESSION_BODY - CALL 'public abstract fun provideStubContext (serviceId: kotlin.Long): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RpcClient' type=kotlin.coroutines.CoroutineContext origin=null - $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.coroutines.CoroutineContext - correspondingProperty: PROPERTY name:coroutineContext visibility:public modality:FINAL [val] - overridden: - public abstract fun (): kotlin.coroutines.CoroutineContext declared in .BoxService - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.coroutines.CoroutineContext declared in .BoxService.$rpcServiceStub' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final]' type=kotlin.coroutines.CoroutineContext origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.Companion PROPERTY name:fqName visibility:public modality:FINAL [val] @@ -258,46 +239,31 @@ FILE fqName: fileName:/module_lib_multiModule.kt $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun simple (): kotlin.String declared in .BoxService.$rpcServiceStub' - CALL 'public final fun scopedClientCall (serviceScope: kotlinx.coroutines.CoroutineScope, body: kotlin.coroutines.SuspendFunction0): T of kotlinx.rpc.internal.scopedClientCall declared in kotlinx.rpc.internal' type=kotlin.String origin=null + CALL 'public abstract fun call (call: kotlinx.rpc.RpcCall): T of kotlinx.rpc.RpcClient.call declared in kotlinx.rpc.RpcClient' type=kotlin.String origin=null : kotlin.String - serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=kotlinx.coroutines.CoroutineScope origin=null - body: FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String [suspend] - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .BoxService.$rpcServiceStub.simple' - CALL 'public abstract fun call (call: kotlinx.rpc.RpcCall): T of kotlinx.rpc.RpcClient.call declared in kotlinx.rpc.RpcClient' type=kotlin.String origin=null - : kotlin.String - $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=.BoxService.$rpcServiceStub origin=null - call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null - descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion - callableName: CONST String type=kotlin.String value="simple" - data: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.RpcGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass]' type=.BoxService.$rpcServiceStub.simple$rpcMethod - serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=.BoxService.$rpcServiceStub origin=null + $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=.BoxService.$rpcServiceStub origin=null + call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null + descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion + callableName: CONST String type=kotlin.String value="simple" + data: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.RpcGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass]' type=.BoxService.$rpcServiceStub.simple$rpcMethod + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=.BoxService.$rpcServiceStub origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.RemoteService + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] overridden: - public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.RemoteService + public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] overridden: - public open fun toString (): kotlin.String declared in kotlinx.rpc.RemoteService + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:simple visibility:public modality:ABSTRACT <> ($this:.BoxService) returnType:kotlin.String [suspend] $this: VALUE_PARAMETER name: type:.BoxService - PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract coroutineContext: kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RemoteService - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlinx.rpc.RemoteService) returnType:kotlin.coroutines.CoroutineContext [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RemoteService - $this: VALUE_PARAMETER name: type:kotlinx.rpc.RemoteService Module: main FILE fqName: fileName:/module_main_multiModule.kt FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String diff --git a/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.txt b/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.txt index 92835fc8..41556d0b 100644 --- a/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.txt @@ -1,6 +1,6 @@ Module: lib FILE: module_lib_multiModule.kt - @R|kotlinx/rpc/annotations/Rpc|() public abstract interface BoxService : R|kotlinx/rpc/RemoteService| { + @R|kotlinx/rpc/annotations/Rpc|() public abstract interface BoxService : R|kotlin/Any| { public abstract suspend fun simple(): R|kotlin/String| public final class $rpcServiceStub : R|kotlin/Any| { diff --git a/tests/compiler-plugin-tests/src/testData/box/multiModule.kt b/tests/compiler-plugin-tests/src/testData/box/multiModule.kt index a575bb86..7d668b0a 100644 --- a/tests/compiler-plugin-tests/src/testData/box/multiModule.kt +++ b/tests/compiler-plugin-tests/src/testData/box/multiModule.kt @@ -4,18 +4,16 @@ // MODULE: lib -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc @Rpc -interface BoxService : RemoteService { +interface BoxService { suspend fun simple(): String } // MODULE: main(lib) import kotlinx.coroutines.runBlocking -import kotlinx.rpc.RemoteService import kotlinx.rpc.withService import kotlinx.rpc.codegen.test.TestRpcClient diff --git a/tests/compiler-plugin-tests/src/testData/box/simple.fir.ir.txt b/tests/compiler-plugin-tests/src/testData/box/simple.fir.ir.txt index f45cf01a..8433002f 100644 --- a/tests/compiler-plugin-tests/src/testData/box/simple.fir.ir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/simple.fir.ir.txt @@ -1,5 +1,5 @@ FILE fqName: fileName:/simple.kt - CLASS INTERFACE name:BoxService modality:ABSTRACT visibility:public superTypes:[kotlinx.rpc.RemoteService] + CLASS INTERFACE name:BoxService modality:ABSTRACT visibility:public superTypes:[kotlin.Any] annotations: Rpc $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService @@ -27,25 +27,6 @@ FILE fqName: fileName:/simple.kt RETURN type=kotlin.Nothing from='private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RpcClient visibility:private [final]' type=kotlinx.rpc.RpcClient origin=null receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null - PROPERTY name:coroutineContext visibility:public modality:FINAL [val] - overridden: - public abstract coroutineContext: kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RpcClient - FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final] - EXPRESSION_BODY - CALL 'public abstract fun provideStubContext (serviceId: kotlin.Long): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RpcClient' type=kotlin.coroutines.CoroutineContext origin=null - $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.coroutines.CoroutineContext - correspondingProperty: PROPERTY name:coroutineContext visibility:public modality:FINAL [val] - overridden: - public abstract fun (): kotlin.coroutines.CoroutineContext declared in .BoxService - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.coroutines.CoroutineContext declared in .BoxService.$rpcServiceStub' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final]' type=kotlin.coroutines.CoroutineContext origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.Companion PROPERTY name:fqName visibility:public modality:FINAL [val] @@ -257,46 +238,31 @@ FILE fqName: fileName:/simple.kt $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun simple (): kotlin.String declared in .BoxService.$rpcServiceStub' - CALL 'public final fun scopedClientCall (serviceScope: kotlinx.coroutines.CoroutineScope, body: kotlin.coroutines.SuspendFunction0): T of kotlinx.rpc.internal.scopedClientCall declared in kotlinx.rpc.internal' type=kotlin.String origin=null + CALL 'public abstract fun call (call: kotlinx.rpc.RpcCall): T of kotlinx.rpc.RpcClient.call declared in kotlinx.rpc.RpcClient' type=kotlin.String origin=null : kotlin.String - serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=kotlinx.coroutines.CoroutineScope origin=null - body: FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String [suspend] - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .BoxService.$rpcServiceStub.simple' - CALL 'public abstract fun call (call: kotlinx.rpc.RpcCall): T of kotlinx.rpc.RpcClient.call declared in kotlinx.rpc.RpcClient' type=kotlin.String origin=null - : kotlin.String - $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=.BoxService.$rpcServiceStub origin=null - call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null - descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion - callableName: CONST String type=kotlin.String value="simple" - data: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.RpcGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass]' type=.BoxService.$rpcServiceStub.simple$rpcMethod - serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=.BoxService.$rpcServiceStub origin=null + $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=.BoxService.$rpcServiceStub origin=null + call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null + descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion + callableName: CONST String type=kotlin.String value="simple" + data: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.RpcGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass]' type=.BoxService.$rpcServiceStub.simple$rpcMethod + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=.BoxService.$rpcServiceStub origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.RemoteService + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] overridden: - public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.RemoteService + public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] overridden: - public open fun toString (): kotlin.String declared in kotlinx.rpc.RemoteService + public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:simple visibility:public modality:ABSTRACT <> ($this:.BoxService) returnType:kotlin.String [suspend] $this: VALUE_PARAMETER name: type:.BoxService - PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract coroutineContext: kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RemoteService - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlinx.rpc.RemoteService) returnType:kotlin.coroutines.CoroutineContext [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RemoteService - $this: VALUE_PARAMETER name: type:kotlinx.rpc.RemoteService FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' diff --git a/tests/compiler-plugin-tests/src/testData/box/simple.fir.txt b/tests/compiler-plugin-tests/src/testData/box/simple.fir.txt index dd09bd08..51cb7852 100644 --- a/tests/compiler-plugin-tests/src/testData/box/simple.fir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/simple.fir.txt @@ -1,5 +1,5 @@ FILE: simple.kt - @R|kotlinx/rpc/annotations/Rpc|() public abstract interface BoxService : R|kotlinx/rpc/RemoteService| { + @R|kotlinx/rpc/annotations/Rpc|() public abstract interface BoxService : R|kotlin/Any| { public abstract suspend fun simple(): R|kotlin/String| public final class $rpcServiceStub : R|kotlin/Any| { diff --git a/tests/compiler-plugin-tests/src/testData/box/simple.kt b/tests/compiler-plugin-tests/src/testData/box/simple.kt index 637ba999..88e9769c 100644 --- a/tests/compiler-plugin-tests/src/testData/box/simple.kt +++ b/tests/compiler-plugin-tests/src/testData/box/simple.kt @@ -3,13 +3,12 @@ */ import kotlinx.coroutines.runBlocking -import kotlinx.rpc.RemoteService import kotlinx.rpc.withService import kotlinx.rpc.annotations.Rpc import kotlinx.rpc.codegen.test.TestRpcClient @Rpc -interface BoxService : RemoteService { +interface BoxService { suspend fun simple(): String } diff --git a/tests/compiler-plugin-tests/src/testData/diagnostics/rpcChecked.fir.txt b/tests/compiler-plugin-tests/src/testData/diagnostics/rpcChecked.fir.txt index 67db0517..9129dc8f 100644 --- a/tests/compiler-plugin-tests/src/testData/diagnostics/rpcChecked.fir.txt +++ b/tests/compiler-plugin-tests/src/testData/diagnostics/rpcChecked.fir.txt @@ -1,6 +1,6 @@ FILE: rpcChecked.kt @FILE:R|kotlin/OptIn|(markerClass = vararg((Q|kotlinx/rpc/internal/utils/ExperimentalRpcApi|))) - @R|kotlinx/rpc/annotations/Rpc|() public abstract interface MyService : R|kotlin/Any|, R|kotlinx/rpc/RemoteService| { + @R|kotlinx/rpc/annotations/Rpc|() public abstract interface MyService : R|kotlin/Any| { public final class $rpcServiceStub : R|kotlin/Any| { public final companion object Companion : R|kotlin/Any| { } @@ -9,31 +9,25 @@ FILE: rpcChecked.kt } public final class NotAService : R|kotlin/Any| { - public constructor(coroutineContext: R|kotlin/coroutines/CoroutineContext|): R|NotAService| { + public constructor(): R|NotAService| { super() } - public final val coroutineContext: R|kotlin/coroutines/CoroutineContext| = R|/coroutineContext| - public get(): R|kotlin/coroutines/CoroutineContext| - } public final class MyServiceImpl : R|MyService| { - public constructor(coroutineContext: R|kotlin/coroutines/CoroutineContext|): R|MyServiceImpl| { + public constructor(): R|MyServiceImpl| { super() } - public open override val coroutineContext: R|kotlin/coroutines/CoroutineContext| = R|/coroutineContext| - public get(): R|kotlin/coroutines/CoroutineContext| - } public final inline suspend fun <@R|kotlinx/rpc/annotations/Rpc|() reified T : R|kotlin/Any|> ok(client: R|kotlinx/rpc/RpcClient|, server: R|kotlinx/rpc/RpcServer|, impl: R|T|, myServiceImpl: R|MyService|): R|kotlin/Unit| { R|/client|.R|kotlinx/rpc/withService|() R|/client|.R|kotlinx/rpc/withService|() - R|/server|.R|kotlinx/rpc/registerService|( = registerService@fun (it: R|kotlin/coroutines/CoroutineContext|): R|MyService| { - ^ R|/MyServiceImpl.MyServiceImpl|(R|/it|) + R|/server|.R|kotlinx/rpc/registerService|( = registerService@fun (): R|MyService| { + ^ R|/MyServiceImpl.MyServiceImpl|() } ) - R|/server|.R|kotlinx/rpc/registerService|( = registerService@fun (it: R|kotlin/coroutines/CoroutineContext|): R|T| { + R|/server|.R|kotlinx/rpc/registerService|( = registerService@fun (): R|T| { ^ R|/impl| } ) @@ -54,15 +48,15 @@ FILE: rpcChecked.kt R|/client|.R|kotlinx/rpc/withService|() R|/client|.R|kotlinx/rpc/withService|() R|/client|.R|kotlinx/rpc/withService|() - R|/server|.R|kotlinx/rpc/registerService|( = registerService@fun (it: R|kotlin/coroutines/CoroutineContext|): R|MyServiceImpl| { - ^ R|/MyServiceImpl.MyServiceImpl|(R|/it|) + R|/server|.R|kotlinx/rpc/registerService|( = registerService@fun (): R|MyServiceImpl| { + ^ R|/MyServiceImpl.MyServiceImpl|() } ) - R|/server|.R|kotlinx/rpc/registerService|( = registerService@fun (it: R|kotlin/coroutines/CoroutineContext|): R|NotAService| { - ^ R|/NotAService.NotAService|(R|/it|) + R|/server|.R|kotlinx/rpc/registerService|( = registerService@fun (): R|NotAService| { + ^ R|/NotAService.NotAService|() } ) - R|/server|.R|kotlinx/rpc/registerService|( = registerService@fun (it: R|kotlin/coroutines/CoroutineContext|): R|T| { + R|/server|.R|kotlinx/rpc/registerService|( = registerService@fun (): R|T| { ^ R|/impl| } ) diff --git a/tests/compiler-plugin-tests/src/testData/diagnostics/rpcChecked.kt b/tests/compiler-plugin-tests/src/testData/diagnostics/rpcChecked.kt index 1069d539..999c6fc7 100644 --- a/tests/compiler-plugin-tests/src/testData/diagnostics/rpcChecked.kt +++ b/tests/compiler-plugin-tests/src/testData/diagnostics/rpcChecked.kt @@ -18,15 +18,15 @@ import kotlinx.rpc.internal.utils.ExperimentalRpcApi @Rpc interface MyService -class NotAService(val coroutineContext: CoroutineContext) +class NotAService -class MyServiceImpl(override val coroutineContext: CoroutineContext) : MyService +class MyServiceImpl : MyService inline suspend fun <@Rpc reified T : Any> ok(client: RpcClient, server: RpcServer, impl: T, myServiceImpl: MyService) { client.withService() client.withService() - server.registerService { MyServiceImpl(it) } + server.registerService { MyServiceImpl() } server.registerService { impl } myServiceImpl.awaitFieldInitialization() @@ -44,8 +44,8 @@ inline suspend fun fail(client: RpcClient, server: RpcServer, client.withService<NotAService>() client.withService<T>() - server.registerService<MyServiceImpl> { MyServiceImpl(it) } - server.registerService<NotAService> { NotAService(it) } + server.registerService<MyServiceImpl> { MyServiceImpl() } + server.registerService<NotAService> { NotAService() } server.registerService<T> { impl } myServiceImpl.awaitFieldInitialization<MyServiceImpl>() diff --git a/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.fir.txt b/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.fir.txt index 36f04f50..808bf373 100644 --- a/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.fir.txt +++ b/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.fir.txt @@ -1,6 +1,6 @@ FILE: rpcService.kt @FILE:R|kotlin/OptIn|(markerClass = vararg((Q|kotlinx/rpc/internal/utils/ExperimentalRpcApi|))) - @R|kotlinx/rpc/annotations/Rpc|() public abstract interface MyService : R|kotlin/Any|, R|kotlinx/rpc/RemoteService| { + @R|kotlinx/rpc/annotations/Rpc|() public abstract interface MyService : R|kotlin/Any| { public abstract fun hello(): R|kotlin/Unit| public abstract suspend fun generic(a: R|T|): R|kotlin/Unit| @@ -110,7 +110,7 @@ FILE: rpcService.kt } } - @R|kotlinx/rpc/annotations/Rpc|() public abstract interface MyServiceT : R|kotlin/Any|, R|kotlinx/rpc/RemoteService| { + @R|kotlinx/rpc/annotations/Rpc|() public abstract interface MyServiceT : R|kotlin/Any| { public final class $rpcServiceStub : R|kotlin/Any| { public final companion object Companion : R|kotlin/Any| { } @@ -118,7 +118,7 @@ FILE: rpcService.kt } } - @R|kotlinx/rpc/annotations/Rpc|() public abstract interface MyServiceT2 : R|kotlin/Any|, R|kotlinx/rpc/RemoteService| { + @R|kotlinx/rpc/annotations/Rpc|() public abstract interface MyServiceT2 : R|kotlin/Any| { public final class $rpcServiceStub : R|kotlin/Any| { public final companion object Companion : R|kotlin/Any| { } diff --git a/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.kt b/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.kt index 8ad72ddb..02c13640 100644 --- a/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.kt +++ b/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.kt @@ -10,10 +10,6 @@ import kotlinx.coroutines.flow.* import kotlinx.serialization.Serializable import kotlinx.serialization.Contextual import kotlinx.rpc.annotations.Rpc -import kotlinx.rpc.krpc.streamScoped -import kotlinx.rpc.krpc.withStreamScope -import kotlinx.rpc.krpc.StreamScope -import kotlinx.rpc.krpc.invokeOnStreamScopeCompletion import kotlinx.rpc.internal.utils.ExperimentalRpcApi @Rpc diff --git a/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.fir.txt b/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.fir.txt index 6fd3db61..eeec7357 100644 --- a/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.fir.txt +++ b/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.fir.txt @@ -1,6 +1,6 @@ Module: none FILE: a.kt - @R|kotlinx/rpc/annotations/Rpc|() public abstract interface MyServiceWithStateFlow : R|kotlin/Any|, R|kotlinx/rpc/RemoteService| { + @R|kotlinx/rpc/annotations/Rpc|() public abstract interface MyServiceWithStateFlow : R|kotlin/Any| { public abstract suspend fun hello(flow: R|kotlinx/coroutines/flow/StateFlow|): R|kotlin/Unit| public final class $rpcServiceStub : R|kotlin/Any| { @@ -174,7 +174,7 @@ FILE: b.kt } } - @R|kotlinx/rpc/annotations/Rpc|() public abstract interface MyService : R|kotlin/Any|, R|kotlinx/rpc/RemoteService| { + @R|kotlinx/rpc/annotations/Rpc|() public abstract interface MyService : R|kotlin/Any| { public abstract val flow: R|kotlinx/coroutines/flow/Flow| public get(): R|kotlinx/coroutines/flow/Flow| @@ -744,21 +744,3 @@ FILE: b.kt } } - public final fun main(): R|kotlin/Unit| { - ^main R|kotlinx/coroutines/runBlocking|( = runBlocking@fun R|kotlinx/coroutines/CoroutineScope|.(): R|kotlin/Unit| { - R|kotlinx/rpc/krpc/streamScoped|( = streamScoped@fun R|kotlinx/coroutines/CoroutineScope|.(): R|kotlin/Unit| { - ^@streamScoped Unit - } - ) - lval scope: R|kotlinx/rpc/krpc/StreamScope| = R|kotlinx/rpc/krpc/StreamScope|(R|kotlinx/coroutines/Job|()) - R|kotlinx/rpc/krpc/withStreamScope|(R|/scope|, = withStreamScope@fun R|kotlinx/coroutines/CoroutineScope|.(): R|kotlin/Unit| { - ^@withStreamScope Unit - } - ) - R|kotlinx/rpc/krpc/invokeOnStreamScopeCompletion|( = invokeOnStreamScopeCompletion@fun (it: R|kotlin/Throwable?|): R|kotlin/Unit| { - ^@invokeOnStreamScopeCompletion Unit - } - ) - } - ) - } diff --git a/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.kt b/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.kt index 72baaaca..ff19c70d 100644 --- a/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.kt +++ b/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.kt @@ -27,10 +27,6 @@ import kotlinx.coroutines.flow.* import kotlinx.serialization.Serializable import kotlinx.serialization.Contextual import kotlinx.rpc.annotations.Rpc -import kotlinx.rpc.krpc.streamScoped -import kotlinx.rpc.krpc.withStreamScope -import kotlinx.rpc.krpc.StreamScope -import kotlinx.rpc.krpc.invokeOnStreamScopeCompletion import kotlinx.rpc.internal.utils.ExperimentalRpcApi @Serializable @@ -79,10 +75,3 @@ interface MyService { fun nonSuspendNoFlow() fun nonSuspendNoFlowString(): String } - -fun main(): Unit = runBlocking { - streamScoped {} - val scope = StreamScope(Job()) - withStreamScope(scope) {} - invokeOnStreamScopeCompletion {} -} diff --git a/tests/krpc-compatibility-tests/src/newApi/kotlin/interfaces/Bar.kt b/tests/krpc-compatibility-tests/src/newApi/kotlin/interfaces/Bar.kt index 69afa0f2..549d176a 100644 --- a/tests/krpc-compatibility-tests/src/newApi/kotlin/interfaces/Bar.kt +++ b/tests/krpc-compatibility-tests/src/newApi/kotlin/interfaces/Bar.kt @@ -4,17 +4,15 @@ package interfaces -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc -import kotlin.coroutines.CoroutineContext @Rpc -interface BarInterface : RemoteService { +interface BarInterface { suspend fun get(): Unit suspend fun get2(): Unit } -class BarInterfaceImpl(override val coroutineContext: CoroutineContext) : BarInterface { +class BarInterfaceImpl : BarInterface { override suspend fun get() {} override suspend fun get2() {} diff --git a/tests/krpc-compatibility-tests/src/newApi/kotlin/interfaces/Baz.kt b/tests/krpc-compatibility-tests/src/newApi/kotlin/interfaces/Baz.kt index 1e201d0c..53d05e54 100644 --- a/tests/krpc-compatibility-tests/src/newApi/kotlin/interfaces/Baz.kt +++ b/tests/krpc-compatibility-tests/src/newApi/kotlin/interfaces/Baz.kt @@ -4,19 +4,17 @@ package interfaces -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc import kotlinx.serialization.Serializable -import kotlin.coroutines.CoroutineContext @Serializable data class Baz(val field: String, val field2: String = "") @Rpc -interface BazInterface : RemoteService { +interface BazInterface { suspend fun get(): Baz } -class BazInterfaceImpl(override val coroutineContext: CoroutineContext) : BazInterface { +class BazInterfaceImpl : BazInterface { override suspend fun get(): Baz = Baz("asd", "def") } diff --git a/tests/krpc-compatibility-tests/src/newApi/kotlin/interfaces/Foo.kt b/tests/krpc-compatibility-tests/src/newApi/kotlin/interfaces/Foo.kt index 2e5fa75d..32fc5c69 100644 --- a/tests/krpc-compatibility-tests/src/newApi/kotlin/interfaces/Foo.kt +++ b/tests/krpc-compatibility-tests/src/newApi/kotlin/interfaces/Foo.kt @@ -4,20 +4,18 @@ package interfaces -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc import kotlinx.serialization.Serializable -import kotlin.coroutines.CoroutineContext @Serializable data class Foo(val field: String, val field2: String? = null) @Rpc -interface FooInterface : RemoteService { +interface FooInterface { suspend fun get(): Foo } -class FooInterfaceImpl(override val coroutineContext: CoroutineContext) : FooInterface { +class FooInterfaceImpl : FooInterface { override suspend fun get(): Foo { return Foo("", "") } diff --git a/tests/krpc-compatibility-tests/src/newApi/kotlin/tests/ApiServer.kt b/tests/krpc-compatibility-tests/src/newApi/kotlin/tests/ApiServer.kt index f6ef49a9..e1059e1a 100644 --- a/tests/krpc-compatibility-tests/src/newApi/kotlin/tests/ApiServer.kt +++ b/tests/krpc-compatibility-tests/src/newApi/kotlin/tests/ApiServer.kt @@ -18,9 +18,9 @@ import kotlinx.rpc.registerService class ApiServer : TestApiServer { override fun serveAllInterfaces(rpcServer: RpcServer) { rpcServer.apply { - registerService { FooInterfaceImpl(it) } - registerService { BarInterfaceImpl(it) } - registerService { BazInterfaceImpl(it) } + registerService { FooInterfaceImpl() } + registerService { BarInterfaceImpl() } + registerService { BazInterfaceImpl() } } } } diff --git a/tests/krpc-compatibility-tests/src/oldApi/kotlin/interfaces/Bar.kt b/tests/krpc-compatibility-tests/src/oldApi/kotlin/interfaces/Bar.kt index 99bb0356..92762812 100644 --- a/tests/krpc-compatibility-tests/src/oldApi/kotlin/interfaces/Bar.kt +++ b/tests/krpc-compatibility-tests/src/oldApi/kotlin/interfaces/Bar.kt @@ -4,15 +4,13 @@ package interfaces -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc -import kotlin.coroutines.CoroutineContext @Rpc -interface BarInterface : RemoteService { +interface BarInterface { suspend fun get() } -class BarInterfaceImpl(override val coroutineContext: CoroutineContext) : BarInterface { +class BarInterfaceImpl() : BarInterface { override suspend fun get() {} } diff --git a/tests/krpc-compatibility-tests/src/oldApi/kotlin/interfaces/Baz.kt b/tests/krpc-compatibility-tests/src/oldApi/kotlin/interfaces/Baz.kt index cee355f0..58a5424e 100644 --- a/tests/krpc-compatibility-tests/src/oldApi/kotlin/interfaces/Baz.kt +++ b/tests/krpc-compatibility-tests/src/oldApi/kotlin/interfaces/Baz.kt @@ -4,19 +4,17 @@ package interfaces -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc import kotlinx.serialization.Serializable -import kotlin.coroutines.CoroutineContext @Serializable data class Baz(val field: String) @Rpc -interface BazInterface : RemoteService { +interface BazInterface { suspend fun get(): Baz } -class BazInterfaceImpl(override val coroutineContext: CoroutineContext) : BazInterface { +class BazInterfaceImpl : BazInterface { override suspend fun get(): Baz = Baz("asd") } diff --git a/tests/krpc-compatibility-tests/src/oldApi/kotlin/interfaces/Foo.kt b/tests/krpc-compatibility-tests/src/oldApi/kotlin/interfaces/Foo.kt index 6ca38219..bafee94d 100644 --- a/tests/krpc-compatibility-tests/src/oldApi/kotlin/interfaces/Foo.kt +++ b/tests/krpc-compatibility-tests/src/oldApi/kotlin/interfaces/Foo.kt @@ -4,20 +4,18 @@ package interfaces -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc import kotlinx.serialization.Serializable -import kotlin.coroutines.CoroutineContext @Serializable data class Foo(val field: String) @Rpc -interface FooInterface : RemoteService { +interface FooInterface { suspend fun get(): Foo } -class FooInterfaceImpl(override val coroutineContext: CoroutineContext) : FooInterface { +class FooInterfaceImpl : FooInterface { override suspend fun get(): Foo { return Foo("") } diff --git a/tests/krpc-compatibility-tests/src/oldApi/kotlin/tests/ApiServer.kt b/tests/krpc-compatibility-tests/src/oldApi/kotlin/tests/ApiServer.kt index f6ef49a9..e1059e1a 100644 --- a/tests/krpc-compatibility-tests/src/oldApi/kotlin/tests/ApiServer.kt +++ b/tests/krpc-compatibility-tests/src/oldApi/kotlin/tests/ApiServer.kt @@ -18,9 +18,9 @@ import kotlinx.rpc.registerService class ApiServer : TestApiServer { override fun serveAllInterfaces(rpcServer: RpcServer) { rpcServer.apply { - registerService { FooInterfaceImpl(it) } - registerService { BarInterfaceImpl(it) } - registerService { BazInterfaceImpl(it) } + registerService { FooInterfaceImpl() } + registerService { BarInterfaceImpl() } + registerService { BazInterfaceImpl() } } } } diff --git a/utils/build.gradle.kts b/utils/build.gradle.kts index 23b50d83..1a8f9afa 100644 --- a/utils/build.gradle.kts +++ b/utils/build.gradle.kts @@ -18,5 +18,10 @@ kotlin { implementation(libs.coroutines.core) } } + commonTest { + dependencies { + implementation(kotlin("test")) + } + } } } diff --git a/utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.kt b/utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.kt new file mode 100644 index 00000000..daae0115 --- /dev/null +++ b/utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.kt @@ -0,0 +1,50 @@ +@file:Suppress("detekt.MatchingDeclarationName") + +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.internal.utils.thread + +import kotlinx.rpc.internal.utils.InternalRpcApi +import kotlinx.rpc.internal.utils.map.RpcInternalConcurrentHashMap + +/** + * A cross-platform implementation of ThreadLocal for Kotlin Multiplatform. + * This class provides thread-local variables, which are variables that are local to a thread. + * Each thread that accesses a thread-local variable has its own, independently initialized copy of the variable. + */ +@InternalRpcApi +public class RpcInternalThreadLocal { + private val map = RpcInternalConcurrentHashMap() + + /** + * Returns the value of this thread-local variable for the current thread or null. + */ + public fun get(): T? { + val threadId = currentThreadId() + return map[threadId] + } + + /** + * Sets the value of this thread-local variable for the current thread. + */ + public fun set(value: T) { + val threadId = currentThreadId() + map[threadId] = value + } + + /** + * Removes the value of this thread-local variable for the current thread. + */ + public fun remove() { + val threadId = currentThreadId() + map.remove(threadId) + } +} + +/** + * Returns the current thread's ID. + * This is a platform-specific function that must be implemented for each platform. + */ +internal expect fun currentThreadId(): Long diff --git a/utils/src/commonTest/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocalTest.kt b/utils/src/commonTest/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocalTest.kt new file mode 100644 index 00000000..214dc627 --- /dev/null +++ b/utils/src/commonTest/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocalTest.kt @@ -0,0 +1,47 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.internal.utils.thread + +import kotlin.test.Test +import kotlin.test.assertEquals + +class ThreadLocalTest { + @Test + fun testGetWithInitialValue() { + val threadLocal = RpcInternalThreadLocal() + val value = threadLocal.get() + assertEquals(null, value) + } + + @Test + fun testSetAndGet() { + val threadLocal = RpcInternalThreadLocal() + threadLocal.set(42) + val value = threadLocal.get() + assertEquals(42, value) + } + + @Test + fun testRemove() { + val threadLocal = RpcInternalThreadLocal() + threadLocal.set("value") + assertEquals("value", threadLocal.get()) + + threadLocal.remove() + assertEquals(null, threadLocal.get()) + } + + @Test + fun testMultipleThreadLocals() { + val threadLocal1 = RpcInternalThreadLocal() + val threadLocal2 = RpcInternalThreadLocal() + + threadLocal1.set("value1") + threadLocal2.set(42) + + assertEquals("value1", threadLocal1.get()) + assertEquals(42, threadLocal2.get()) + } +} diff --git a/utils/src/jsMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.js.kt b/utils/src/jsMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.js.kt new file mode 100644 index 00000000..ee410c84 --- /dev/null +++ b/utils/src/jsMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.js.kt @@ -0,0 +1,16 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.internal.utils.thread + +import kotlinx.rpc.internal.utils.InternalRpcApi + +/** + * JS implementation of currentThreadId. + * Since JavaScript is single-threaded (except for Web Workers), we use a global counter + * to simulate thread IDs. In a real multi-threaded environment with Web Workers, + * a more sophisticated approach would be needed. + */ +@InternalRpcApi +public actual fun currentThreadId(): Long = 1L // Always return 1 for main thread in JS diff --git a/utils/src/jvmMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.jvm.kt b/utils/src/jvmMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.jvm.kt new file mode 100644 index 00000000..17c23cfd --- /dev/null +++ b/utils/src/jvmMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.jvm.kt @@ -0,0 +1,13 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.internal.utils.thread + +import kotlinx.rpc.internal.utils.InternalRpcApi + +/** + * JVM implementation of currentThreadId that returns the current thread's ID. + */ +@InternalRpcApi +public actual fun currentThreadId(): Long = Thread.currentThread().id diff --git a/utils/src/jvmTest/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocalJvmTest.kt b/utils/src/jvmTest/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocalJvmTest.kt new file mode 100644 index 00000000..dac21693 --- /dev/null +++ b/utils/src/jvmTest/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocalJvmTest.kt @@ -0,0 +1,71 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.internal.utils.thread + +import kotlin.test.Test +import kotlin.test.assertEquals +import java.util.concurrent.CountDownLatch +import kotlin.concurrent.thread + +class ThreadLocalJvmTest { + @Test + fun testThreadLocalInMultipleThreads() { + val threadLocal = RpcInternalThreadLocal() + val mainThreadId = Thread.currentThread().id + + // Set a value in the main thread + threadLocal.set("main-thread-value") + + // Create a new thread and verify it has its own value + val latch = CountDownLatch(1) + var threadIdRef: Long = -1 + var threadValueRef: String? = null + + thread { + try { + // This thread should have a different thread ID + threadIdRef = Thread.currentThread().id + + // The thread local should return the default value since we haven't set it in this thread + threadValueRef = threadLocal.get() + + // Now set a different value in this thread + threadLocal.set("worker-thread-value") + } finally { + latch.countDown() + } + } + + // Wait for the thread to complete + latch.await() + + // Verify the main thread's value is still intact + assertEquals("main-thread-value", threadLocal.get()) + + // Verify the worker thread had a different ID + assert(threadIdRef != mainThreadId) { "Worker thread should have a different ID" } + + // Verify the worker thread initially got the default value + assertEquals(null, threadValueRef) + + // Create another thread to verify the worker thread's value + val latch2 = CountDownLatch(1) + var threadValue2Ref: String? = null + + thread { + try { + // This should be a new thread with its own value + threadValue2Ref = threadLocal.get() + } finally { + latch2.countDown() + } + } + + latch2.await() + + // Verify the second thread got its own default value + assertEquals(null, threadValue2Ref) + } +} diff --git a/utils/src/nativeMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.native.kt b/utils/src/nativeMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.native.kt new file mode 100644 index 00000000..46654111 --- /dev/null +++ b/utils/src/nativeMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.native.kt @@ -0,0 +1,17 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.internal.utils.thread + +import kotlinx.rpc.internal.utils.InternalRpcApi +import kotlin.native.concurrent.ObsoleteWorkersApi +import kotlin.native.concurrent.Worker + +/** + * Native implementation of currentThreadId that returns the current worker's ID. + * In Kotlin/Native, we use Worker.current.id as a thread identifier. + */ +@OptIn(ObsoleteWorkersApi::class) +@InternalRpcApi +public actual fun currentThreadId(): Long = Worker.current.id.toLong() diff --git a/utils/src/nativeTest/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocalNativeTest.kt b/utils/src/nativeTest/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocalNativeTest.kt new file mode 100644 index 00000000..51bd8d21 --- /dev/null +++ b/utils/src/nativeTest/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocalNativeTest.kt @@ -0,0 +1,106 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.internal.utils.thread + +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.native.concurrent.ObsoleteWorkersApi +import kotlin.native.concurrent.Worker +import kotlin.native.concurrent.TransferMode +import kotlin.experimental.ExperimentalNativeApi + +class ThreadLocalNativeTest { + @OptIn(ObsoleteWorkersApi::class, ExperimentalNativeApi::class) + @Test + fun testThreadLocalInWorkers() { + val threadLocal = RpcInternalThreadLocal() + val mainWorkerId = Worker.current.id.toLong() + + // Set a value in the main worker + threadLocal.set("main-worker-value") + + // Create a new worker and verify it has its own value + val worker = Worker.start() + + // Execute a task in the worker + val future = worker.execute(TransferMode.SAFE, { threadLocal }) { tl -> + // Get the worker's ID + val workerId = Worker.current.id.toLong() + + // Get the initial value (should be null since we haven't set it in this worker) + val initialValue = tl.get() + + // Set a new value in this worker + tl.set("worker-value") + + // Return the worker ID and initial value + Pair(workerId, initialValue) + } + + // Wait for the worker to complete and get the results + val (workerId, workerInitialValue) = future.result + + // Verify the worker had a different ID + assert(workerId != mainWorkerId) { "Worker should have a different ID" } + + // Verify the worker initially got null (default value) + assertEquals(null, workerInitialValue) + + // Verify the main worker's value is still intact + assertEquals("main-worker-value", threadLocal.get()) + + // Create another worker to verify isolation + val worker2 = Worker.start() + + val future2 = worker2.execute(TransferMode.SAFE, { threadLocal }) { tl -> + // This should be a new worker with its own value + tl.get() + } + + // Verify the second worker got null (default value) + assertEquals(null, future2.result) + + // Clean up + worker.requestTermination().result + worker2.requestTermination().result + } + + @OptIn(ObsoleteWorkersApi::class, ExperimentalNativeApi::class) + @Test + fun testMultipleThreadLocalsInWorkers() { + val threadLocal1 = RpcInternalThreadLocal() + val threadLocal2 = RpcInternalThreadLocal() + + // Set values in the main worker + threadLocal1.set("main-value") + threadLocal2.set(42) + + // Create a worker and set different values + val worker = Worker.start() + + val future = worker.execute(TransferMode.SAFE, { Pair(threadLocal1, threadLocal2) }) { (tl1, tl2) -> + // Set different values in the worker + tl1.set("worker-value") + tl2.set(99) + + // Return the values + Pair(tl1.get(), tl2.get()) + } + + // Get the worker's values + val (workerValue1, workerValue2) = future.result + + // Verify the worker's values + assertEquals("worker-value", workerValue1) + assertEquals(99, workerValue2) + + // Verify the main worker's values are unchanged + assertEquals("main-value", threadLocal1.get()) + assertEquals(42, threadLocal2.get()) + + // Clean up + worker.requestTermination().result + } +} diff --git a/utils/src/wasmJsMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.wasm.kt b/utils/src/wasmJsMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.wasm.kt new file mode 100644 index 00000000..417186aa --- /dev/null +++ b/utils/src/wasmJsMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.wasm.kt @@ -0,0 +1,14 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.internal.utils.thread + +import kotlinx.rpc.internal.utils.InternalRpcApi + +/** + * WASM JS implementation of currentThreadId. + * Since WASM JS is single-threaded (similar to regular JS), we return a constant value. + */ +@InternalRpcApi +public actual fun currentThreadId(): Long = 1L // Always return 1 for main thread in WASM JS diff --git a/utils/src/wasmWasiMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.wasi.kt b/utils/src/wasmWasiMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.wasi.kt new file mode 100644 index 00000000..3a4b6bbc --- /dev/null +++ b/utils/src/wasmWasiMain/kotlin/kotlinx/rpc/internal/utils/thread/ThreadLocal.wasi.kt @@ -0,0 +1,14 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.internal.utils.thread + +import kotlinx.rpc.internal.utils.InternalRpcApi + +/** + * WASM WASI implementation of currentThreadId. + * Since WASM WASI is single-threaded in the current implementation, we return a constant value. + */ +@InternalRpcApi +public actual fun currentThreadId(): Long = 1L // Always return 1 for main thread in WASM WASI