Skip to content

Conversation

@cucuwritescode
Copy link
Contributor

summary

fixes data loss issue where flushed buffers in _processed_data_msg_queue were discarded when stop_streaming() was called causing users to lose final data chunks.

issue

when stop_streaming() was called, the _processed_data_msg_queue was cleared by creating a new empty queue,
discarding any remaining messages that hadn't been processed yet. This resulted in users losing their final data
chunks.

solution

before clearing the queue, safely drain all remaining messages and add them to the appropriate
streaming_buffers_queue so users can access their complete data. The implementation includes comprehensive error
handling to ensure robustness.

what was changed

  • added buffer collection logic in _async_stop_streaming() before queue clearing
  • implemented triple-layer error handling for max stability
  • preserved all existing functionality with graceful fallback behaviour

tests

  • verifief preservation of data with test scenarios
  • confirmed error handling with corrupted messages
  • validated no breaking changes to existing functionality

collect remaining messages from _processed_data_msg_queue before clearing to assure users don't lose final data chunkjs when stopping streaming. + comprehensive error handling to maintain stability.
@pelinski pelinski self-requested a review August 26, 2025 10:55
@pelinski pelinski changed the base branch from main to dev August 26, 2025 10:57
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.

1 participant