Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #1814 update_content for debug off #2187

Closed

Conversation

rohitdash08
Copy link

This PR fix #1814

Description:
Fixes issue with update_content() behavior inconsistency in debug vs. non-debug modes.

Summary of Changes:

Introduced a queue-based system (UpdateQueue) to batch and control the frequency of updates for partials.

Implemented two batch intervals:
STREAM_MODE_BATCH_INTERVAL for smooth updates during streaming (0.05s).
STANDARD_BATCH_INTERVAL for non-streaming updates (0.2s).

Added thread safety using locks to ensure consistent updates and prevent race conditions.

Created a new method _process_updates() to handle queued updates and apply only the most recent change.

Added a force_update() method for forced updates when necessary.

Impact:
This fix addresses the "chunky" updates observed when debug mode is off, ensuring smoother and more consistent content updates across all modes.

Copy link
Member

@FredLL-Avaiga FredLL-Avaiga left a comment

Choose a reason for hiding this comment

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

Tx @rohitdash08
I cannot run your code, can you fix it
The linter agrees with me :-)

@FredLL-Avaiga
Copy link
Member

I'm not even sure we want to fix this issue ...

@FredLL-Avaiga
Copy link
Member

Are you still working on this @rohitdash08 ?
I think we'll drop this PR

@rohitdash08
Copy link
Author

@FredLL-Avaiga, No I'm not working on this as we can use chat control with streaming.

@FredLL-Avaiga
Copy link
Member

no use case

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.

[🐛 BUG] Update content behaves differently with debug mode on/off
2 participants