[rd][debugger] IJPL-177087 FrontendXDebuggerSession: Handle flows cancellation

GitOrigin-RevId: c7d3efa2a380dd73cdd23ac6854eb1c9e582a2fc
This commit is contained in:
Alexander Kuznetsov
2025-03-25 02:02:28 +00:00
committed by intellij-monorepo-bot
parent 2f8dad09fb
commit 3db6c38939
@@ -90,16 +90,10 @@ internal class FrontendXDebuggerSession private constructor(
send(null)
return@collectLatest
}
val childScope = cs.childScope(
"Suspend Context ${suspendContextDto.id}"
)
try {
send(FrontendXSuspendContext(suspendContextDto, childScope))
supervisorScope {
send(FrontendXSuspendContext(suspendContextDto, this))
awaitCancellation()
}
finally {
childScope.cancel()
}
}
}.stateIn(cs, SharingStarted.Eagerly, null)
@@ -110,8 +104,10 @@ internal class FrontendXDebuggerSession private constructor(
send(null)
return@collectLatest
}
// TODO[IJPL-177087] narrower scope?
send(FrontendXExecutionStack(executionStackDto, cs))
supervisorScope {
send(FrontendXExecutionStack(executionStackDto, this))
awaitCancellation()
}
}
}.stateIn(cs, SharingStarted.Eagerly, null)
@@ -122,8 +118,10 @@ internal class FrontendXDebuggerSession private constructor(
send(null)
return@collectLatest
}
return@collectLatest
send(FrontendXStackFrame(stackFrameDto))
supervisorScope {
send(FrontendXStackFrame(stackFrameDto))
awaitCancellation()
}
}
}.stateIn(cs, SharingStarted.Eagerly, null)