Fix Bluetooth auto-connect race conditions and simplify tests - #9666
Conversation
- Moved the saved device check strictly into `autoConnect` within `useBluetoothHRM`. - Added missing `connectionLock.current = false` inside `finally` block of `connectToGatt` to prevent connection loops/leaks. - Dropped stale memory variables (`isTimeoutDisconnect`). - Removed environment-specific constants from `bluetooth-reconnection.ts` for improved testability and tree-shaking. - Reverted PR-induced over-engineering in `vrt-dashboard.spec.ts` while preserving the intended race condition fixes via centralized `waitForWebSocketConnection` utility. Co-authored-by: arii <342438+arii@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
👋 Welcome to HRM!Thanks for your contribution. This repository uses Gemini AI for automated triage, code review, and generation. 🤖 Gemini Manual Trigger Quick Reference
For more details and GitHub CLI examples, see the Manual Trigger Guide. |
- Moved the saved device check strictly into `autoConnect` within `useBluetoothHRM`. - Added missing `connectionLock.current = false` inside `finally` block of `connectToGatt` to prevent connection loops/leaks. - Dropped stale memory variables (`isTimeoutDisconnect`). - Removed environment-specific constants from `bluetooth-reconnection.ts` for improved testability and tree-shaking. - Reverted PR-induced over-engineering in `vrt-dashboard.spec.ts` while preserving the intended race condition fixes via centralized `waitForWebSocketConnection` utility. Co-authored-by: arii <342438+arii@users.noreply.github.com>
🤖 Gemini Review SkippedReview was skipped for the following reason: 🤖 Gemini Manual Trigger Guide |
c890038
into
fix-bluetooth-race-condition-17974409934683189531
Refactored connection locks to fix race conditions as outlined in PR review directives. Simplified constants and visual test setups to avoid over-engineering.
PR created automatically by Jules for task 16041091462057628058 started by @arii