Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

Refactor Assist audio recording to fix race condition using Channel#6211

Merged
TimoPtr merged 3 commits intomainfrom
fix/assist-concurrent-crash
Dec 31, 2025
Merged

Refactor Assist audio recording to fix race condition using Channel#6211
TimoPtr merged 3 commits intomainfrom
fix/assist-concurrent-crash

Conversation

@TimoPtr
Copy link
Member

@TimoPtr TimoPtr commented Dec 29, 2025

Summary

Refactored the audio recording pipeline in AssistViewModelBase to fix a race condition when buffering audio data before STT is ready.

The issue was mostly seen when using a watch, but also on other low end devices. The issue was that the queue was nullify before all the data were fully sent. The new approach is to use a channel to store the data and make sure that we only use this to send the data. We only send the data when we reach the SST_START event.

Checklist

  • New or updated tests have been added to cover the changes following the testing guidelines.
  • The code follows the project's code style and best_practices.
  • The changes have been thoroughly tested, and edge cases have been considered.
  • Changes are backward compatible whenever feasible. Any breaking changes are documented in the changelog for users and/or in the code for developers depending on the relevance.

Any other notes

Based on #6188.
Fixes #6048

@github-actions
Copy link
Contributor

github-actions bot commented Dec 29, 2025

Test Results

114 files  +1  114 suites  +1   7m 46s ⏱️ +30s
967 tests +6  967 ✅ +6  0 💤 ±0  0 ❌ ±0 
980 runs  +7  980 ✅ +7  0 💤 ±0  0 ❌ ±0 

Results for commit cb1be24. ± Comparison against base commit 2535215.

♻️ This comment has been updated with latest results.

@TimoPtr TimoPtr force-pushed the fix/assist-concurrent-crash branch 2 times, most recently from cb1be24 to a857ff2 Compare December 29, 2025 16:47
@jpelgrom jpelgrom linked an issue Dec 30, 2025 that may be closed by this pull request
@TimoPtr TimoPtr force-pushed the fix/assist-concurrent-crash branch 2 times, most recently from 6f683b3 to 03639ea Compare December 31, 2025 10:38
@TimoPtr TimoPtr requested a review from jpelgrom December 31, 2025 11:17
Base automatically changed from feature/assist-streaming-tts to main December 31, 2025 12:10
@TimoPtr TimoPtr force-pushed the fix/assist-concurrent-crash branch from 03639ea to 791680b Compare December 31, 2025 12:15
@TimoPtr TimoPtr enabled auto-merge (squash) December 31, 2025 12:25
@TimoPtr TimoPtr merged commit 849cd73 into main Dec 31, 2025
22 checks passed
@TimoPtr TimoPtr deleted the fix/assist-concurrent-crash branch December 31, 2025 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assist on WearOS closes without actioning request

2 participants