Skip to content

Commit a60c9c1

Browse files
authored
fix(toolkit): Fix/gateway coroutines (#6132)
* refactor(gateway): use withContext for coroutines instead of duplicating files Address PR #6098 review feedback to avoid copying entire Gateway files for IDE version compatibility. Changes: - Replace deprecated coroutine APIs with withContext(getCoroutineBgContext()) - startChildSyncIOBackgroundAsync().await() → withContext - lifetime.launchIOBackground → withContext - lifetime.launchOnUiAnyModality → lifetime.launchOnUi - launchChildSyncIOBackground → withContext - Remove manual CoroutineScope + SupervisorJob creation - Move files to common src/ directory (works across all IDE versions) - Delete duplicated src-242-252/ and src-253+/ versions The withContext API is available in all IDE versions, eliminating the need for version-specific file duplication. Coroutine scopes now properly inherit from parent contexts instead of manually creating SupervisorJobs. Tested: - ✅ Compiles for IDE 2024.2-2025.2 - ✅ Compiles for IDE 2025.3+ - ✅ Detekt code style checks pass * fix: use launch instead of withContext for fire-and-forget coroutines Address PR review feedback to match original invocation semantics. Changed from withContext (which suspends and waits) to launch (fire-and-forget) for: - Publishing environment started notification - Stopping environment and reconnecting
1 parent c33256c commit a60c9c1

File tree

4 files changed

+5
-1267
lines changed

4 files changed

+5
-1267
lines changed

0 commit comments

Comments
 (0)