Skip to content

Conversation

@o-santi
Copy link
Contributor

@o-santi o-santi commented Nov 6, 2025

What kind of change does this PR introduce?

Stop timeout_callback from being called after a successful message arrives, by canceling the task inside trigger. This is happening because the timeout_task inside the AsyncPush class wasn't being canceled, ever, so it would trigger the timeout every time. The default timeout task just logs that it timed out, so it was pretty harmless. However, this is a pretty bad bug to have.

Fixes #1297.

Additional context

Add any other context or screenshots.

@o-santi o-santi merged commit 7e3b81a into main Nov 6, 2025
11 of 17 checks passed
@o-santi o-santi deleted the realtime/cancel-timeout branch November 6, 2025 17:45
@SmaugPool
Copy link

Note that the timeout also leads to calling subscribe() callback (if registered) with RealtimeSubscribeStates.TIMED_OUT state, possibly causing some reconnection loop from user code when it tries to handle the timeout (like I did). It is therefore not always as harmless as just a log.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 19143493446

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 92.59%

Files with Coverage Reduction New Missed Lines %
src/realtime/_async/push.py 3 78.48%
Totals Coverage Status
Change from base Build 19043813501: 0.02%
Covered Lines: 8759
Relevant Lines: 9460

💛 - Coveralls

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.

Unexpected RealtimeSubscribeStates.TIMED_OUT 10 seconds after subscribe()

5 participants