Skip to content

Comments

Fix various incorrect coroutine usage#1980

Merged
SessionHero01 merged 5 commits intorelease/1.31.3from
fix-supervisor-issue
Feb 20, 2026
Merged

Fix various incorrect coroutine usage#1980
SessionHero01 merged 5 commits intorelease/1.31.3from
fix-supervisor-issue

Conversation

@SessionHero01
Copy link
Collaborator

@SessionHero01 SessionHero01 commented Feb 20, 2026

Issues:

  1. No error handling inside launch block from supervisorScope
  2. Some error handling else where misses CancellationException handling
  3. Removes unneeded supervisorScope

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes incorrect coroutine usage across multiple polling and configuration components by properly handling CancellationException and removing unnecessary coroutine scopes. The changes ensure that coroutine cancellation is propagated correctly, which is critical for proper cleanup and resource management in Kotlin coroutines.

Changes:

  • Added CancellationException re-throw logic in exception handlers to ensure proper coroutine cancellation propagation
  • Refactored OpenGroupPollerManager.pollAllOpenGroupsOnce() to use async/awaitAll instead of launch/joinAll for cleaner error propagation
  • Removed unnecessary supervisorScope wrapper from MessageSender.sendToSnodeDestination() since it doesn't launch child coroutines

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ConfigUploader.kt Added CancellationException checks in two catch blocks to properly propagate coroutine cancellation
Poller.kt Added CancellationException check in TTL extension error handler to prevent swallowing cancellation
OpenGroupPollerManager.kt Refactored polling logic to use async/awaitAll pattern and removed manual error handling in favor of exception propagation
OpenGroupPoller.kt Wrapped polling operations in try-catch blocks with CancellationException checks to ensure proper error handling while preserving cancellation
MessageSender.kt Removed unnecessary supervisorScope wrapper since the function doesn't launch child coroutines

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SessionHero01 SessionHero01 merged commit 105029d into release/1.31.3 Feb 20, 2026
4 checks passed
@SessionHero01 SessionHero01 deleted the fix-supervisor-issue branch February 20, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants