Skip to content

Improve WebSocket message handling and keepalive task management#2

Open
Yacinewhatchandcode wants to merge 1 commit intomainfrom
cursor/fix-three-codebase-bugs-2344
Open

Improve WebSocket message handling and keepalive task management#2
Yacinewhatchandcode wants to merge 1 commit intomainfrom
cursor/fix-three-codebase-bugs-2344

Conversation

@Yacinewhatchandcode
Copy link
Owner

ok

Co-authored-by: yacine.benhamou <yacine.benhamou@gmail.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bugbot free trial expires on August 20, 2025
Learn more in the Cursor dashboard.

if not hasattr(app, 'keepalive_task'):
if not hasattr(app, 'keepalive_task') or app.keepalive_task.done():
if hasattr(app, 'keepalive_task') and not app.keepalive_task.done():
app.keepalive_task.cancel()
Copy link

Choose a reason for hiding this comment

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

Bug: Dead Code Prevents Proper Task Cancellation

The app.keepalive_task.cancel() line is unreachable dead code. The outer if condition allows entry if app.keepalive_task does not exist or is already done. However, the nested if condition, which contains the cancellation logic, requires the task to exist and not be done. These conditions are mutually exclusive, preventing the cancellation from ever executing and potentially leading to uncanceled tasks.

Fix in Cursor Fix in Web

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