diff --git a/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/Sink.kt b/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/Sink.kt index b24294964..5d0d79b4f 100644 --- a/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/Sink.kt +++ b/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/Sink.kt @@ -85,7 +85,9 @@ internal suspend fun < ) { suspendCancellableCoroutine { continuation -> val resumingAction = object : WorkflowAction() { - override fun toString(): String = "sendAndAwaitApplication($action)" + // Pipe through debugging name to the original action. + override val debuggingName: String + get() = action.debuggingName override fun Updater.apply() { // Don't execute anything if the caller was cancelled while we were in the queue. diff --git a/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/WorkerWorkflow.kt b/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/WorkerWorkflow.kt index dedfa5902..24e09abeb 100644 --- a/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/WorkerWorkflow.kt +++ b/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/WorkerWorkflow.kt @@ -89,13 +89,12 @@ internal suspend fun runWorker( } private class EmitWorkerOutputAction( - private val worker: Worker<*>, - private val renderKey: String, + worker: Worker<*>, + renderKey: String, private val output: O, ) : WorkflowAction() { - override val debuggingName: String - get() = CommonKClassTypeNamer.uniqueName(EmitWorkerOutputAction::class) + - "(worker=$worker, key=$renderKey)" + override val debuggingName: String = + "EmitWorkerOutputAction(worker=$worker, key=$renderKey)" override fun Updater.apply() { setOutput(output) diff --git a/workflow-tracing/src/test/resources/com/squareup/workflow1/diagnostic/tracing/expected_trace_file.txt b/workflow-tracing/src/test/resources/com/squareup/workflow1/diagnostic/tracing/expected_trace_file.txt index bb72869fa..0752ddbff 100644 --- a/workflow-tracing/src/test/resources/com/squareup/workflow1/diagnostic/tracing/expected_trace_file.txt +++ b/workflow-tracing/src/test/resources/com/squareup/workflow1/diagnostic/tracing/expected_trace_file.txt @@ -60,8 +60,8 @@ {"name":"used/free memory","ph":"C","ts":0,"pid":0,"tid":0,"args":{"usedMemory":1,"freeMemory":42}}, {"name":"Snapshot","ph":"B","ts":0,"pid":0,"tid":0,"args":{}}, {"name":"Snapshot","ph":"E","ts":0,"pid":0,"tid":0,"args":{}}, -{"name":"Sink received: Worker (2)","cat":"update","ph":"i","ts":0,"pid":0,"tid":0,"s":"t","args":{"action":"sendAndAwaitApplication(action(com.squareup.workflow1.EmitWorkerOutputAction(worker=TypedWorker(java.lang.String (Kotlin reflection is not available)), key=)))"}}, -{"name":"WorkflowAction: Worker (2)","cat":"update","ph":"i","ts":0,"pid":0,"tid":0,"s":"p","args":{"action":"sendAndAwaitApplication(action(com.squareup.workflow1.EmitWorkerOutputAction(worker=TypedWorker(java.lang.String (Kotlin reflection is not available)), key=)))","oldState":"0","newState":"{no change}","output":"fired!"}}, +{"name":"Sink received: Worker (2)","cat":"update","ph":"i","ts":0,"pid":0,"tid":0,"s":"t","args":{"action":"action(EmitWorkerOutputAction(worker=TypedWorker(java.lang.String (Kotlin reflection is not available)), key=))"}}, +{"name":"WorkflowAction: Worker (2)","cat":"update","ph":"i","ts":0,"pid":0,"tid":0,"s":"p","args":{"action":"action(EmitWorkerOutputAction(worker=TypedWorker(java.lang.String (Kotlin reflection is not available)), key=))","oldState":"0","newState":"{no change}","output":"fired!"}}, {"name":"Worker (2)","ph":"O","ts":0,"pid":0,"tid":0,"id":"2","args":{"snapshot":"0"}}, {"name":"Render Pass","cat":"rendering","ph":"B","ts":0,"pid":0,"tid":0,"args":{"props":"3"}}, {"name":"used/free memory","ph":"C","ts":0,"pid":0,"tid":0,"args":{"usedMemory":1,"freeMemory":42}},