-
Notifications
You must be signed in to change notification settings - Fork 4
feat(large): fix: correct stale HRM data detection and refactor types #7670
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
base: fix/stale-hr-tile-persistence-791622865149962011
Are you sure you want to change the base?
Conversation
- Centralize HRM data types in `types/websocket.ts` (`ConnectedHrmData`, `ClientHrmData`) and remove redundant definitions in `context/webSocketReducer.ts` and `utils/hrm.ts`. - Fix logic in `utils/hrm.ts` to use `updatedAt` (sensor timestamp) instead of `lastUpdated` (receipt timestamp) for staleness detection. - Refactor `components/HrTileWrapper.tsx` to use flattened props and simple `React.memo` (removing custom comparator). - Clean up `components/HrmTiles.tsx` by removing duplicate code blocks and verbose comments. - Update `components/HrmConnectionPanel.tsx` to use refactored `HrTileWrapper`. - Revert unintended changes in `deploy/runner/README.md`. - Add unit test case for stale sensor data scenario in `tests/unit/utils/hrm.test.ts`. - Update `tests/unit/components/HrTileWrapper.test.tsx` and `tests/mocks/components.tsx` to align with new props structure. 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. |
📋 Quality Gate Results
❌ Lint Failure Details❌ Infrastructure Test Failure Details❌ Unit Test Failure Details❌ Component Test Failure Details❌ Visual Test Failure Details❌ Performance Test Failure Details
|
Fixed lint errors in |
Description
This PR corrects stale HRM data detection and refactors types. It addresses the "ghost tile" issue where stale data was not being flagged correctly because the client was using the message receipt timestamp (
lastUpdated) instead of the sensor's origin timestamp (updatedAt).The motivation is to ensure accurate and timely display of Heart Rate Monitor (HRM) data by using the correct timestamp for staleness detection, resolving the "ghost tile" problem. Additionally, the HRM data types have been refactored for better consistency, and the component code has been cleaned up for improved performance (memoization) and readability.
Fixes # (issue)
Change Type: 🐛 Bug fix (non-breaking change fixing an issue)
PR Scope Checklist
This checklist is mandatory for all PRs.
Impact Assessment
Original PR Body
This PR addresses the "ghost tile" issue where stale data was not being flagged correctly because the client was using the message receipt timestamp (
lastUpdated) instead of the sensor's origin timestamp (updatedAt). It also refactors the HRM data types for better consistency and cleans up the component code for better performance (memoization) and readability.PR created automatically by Jules for task 12774384463479310696 started by @arii