Repository navigation
Erase ring history after sync and fix per-ring sync stalls - #142
Open
saksham2001 wants to merge 5 commits into
Open
saksham2001 wants to merge 5 commits into
saksham2001 wants to merge 5 commits into
Conversation
…ead of the watchdog
…tead of every sync
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PulseLoop never cleared a ring's stored history after syncing, so every sync re-sent the full log. This PR copies what each vendor app actually does, taken from the decompiled apps and vendor SDKs, and fixes the timeout stalls that slowed down the rings that have no clear command.
Clearing stored history (
0441a3a)RingHistoryCommitcheck makes the app save everything synced so far to disk (a save that reports failure) before any ring history is erased. Sync engines call it throughRingCommandWriter.commitDeliveredHistory. If the save fails, times out, or no one is listening, nothing is erased; the ring keeps its data and the next sync reads it again.05 <0x40…0x4E> 02, as SmartHealth'sDataSyncUtilsdoes.0x47, not0x46.02 01capability list on this connection.05 xx 30), matching the vendor's per-page loop. Each page is saved first. Empty pages are never deleted.207is only sent from a manual "Clear data" button. What the vendor does do is ACK every completed frame except dataType 144 (CEProtocolB.Analysis), so we now do the same.Sync stalls
1cd4782): a timing stream that hasn't sent its first frame within 5 s no longer holds the pass open. A ring that ignores stress now finishes in ~5 s instead of the 15 s watchdog.9d4962e):bc 27 02 00 81 80 ff 01.2923565): a dedicated SpO₂ or temperature log that never answers (the R99's05 1a) costs one 10 s timeout per connection instead of one on every sync. Core logs are always asked again.024a6b8): history is synced day by day (10 dd→16 dd) from the last finished sync, up to 6 days back, matching the vendor app. Before, only today was ever requested.0x10step history is now decoded.Related issues
Closes #91
Type of change
How was this tested?
PulseLoopTests)⌘Uin Xcode): 1246 tests, 0 failures-seedDemo YES, no hardware)Needs checking on hardware before merge:
02 01, and what YCBT rings reply to a delete.0x10values really are steps per minute.Privacy & data
Screenshots / recordings
N/A — no UI changes.
Checklist