Skip to content

Combine sleep periods, simplify strap sync, preserve valid records - #6

Merged
allenlinsh merged 2 commits into
mainfrom
fix/sleep-naps-strap-sync
Oct 17, 2026
Merged

allenlinsh merged 2 commits into
mainfrom
fix/sleep-naps-strap-sync

Conversation

@allenlinsh

@allenlinsh allenlinsh commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Motion kept only the longest sleep period ending on a date, hiding naps. Retain every period and combine all sleep on that wake date into one daily stage timeline, sleep total, and heart/breathing charts. Weekly totals and averages include all periods too; the schedule preserves the gaps between them. For example, 2h 10m plus 1h 37m displays as 3h 47m. Awake time and unrecorded gaps never count as sleep. Helio wins overlapping records, while Health can fill a separate missing period without duplication.

Move “sync now” beside “strap settings”; the sheet only manages the band key. Save valid sleep records when another record in the transfer fails, preserving the failed record’s previous copy and retry cursor. Clip stage overhangs of at most one minute to the declared session; larger or malformed ranges still fail. A long press on an error copies relative timing diagnostics without keys, packets, absolute timestamps or account information.

Validation: 93 iOS unit tests, the combined sleep and daily/weekly navigation UI flows, and a Release device build passed. The strap settings and Health access UI flows passed in the preceding commit. Synthetic coverage includes split sleep, combined stage totals, empty gaps, heart/breathing averages, duplicate fallback records, DST, close strap sessions, partially invalid transfers, replay and stage-edge clipping. Simulator screenshots were visually checked.

Hardware follow-up required: the reported stage-bounds screenshot does not reveal its actual minute offsets. The one-minute tolerance is not a confirmed diagnosis of that record. Verify direct sync with Zepp closed and compare the sessions on the real strap. No TestFlight build uploaded by this PR.

@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
motion Ready Ready Preview Oct 17, 2026 10:18pm UTC

Request Review

@allenlinsh allenlinsh changed the title Show naps, simplify strap sync, preserve valid sleep records Combine sleep periods, simplify strap sync, preserve valid records Oct 17, 2026
@allenlinsh
allenlinsh marked this pull request as ready for review October 17, 2026 22:41
@allenlinsh
allenlinsh merged commit 4242259 into main Oct 17, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
Preview — 57d6479b Deployed Oct 17, 2026 by vercel[bot]
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.

1 participant