Repository navigation
Fix the implicit state machines (S1 to S23, N1 to N11) - #63
Merged
Merged
Conversation
A wrong or protected key failed the same way on every presence event, Bluetooth restart and phone alert. ConnectErrors.isFinal now counts it, so only the user's own connect or opening the app tries again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, deleted workout page S8: MainActivity reads notification and widget extras in onCreate (fresh launch only) and onNewIntent, not onResume. S16: onResume refreshes phoneAlerts. S23: workout detail is Loading, Found or Missing by key; Missing shows a deleted message. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…uto sync on after first export, one write lock One Bluetooth answer runs the queued workout and the Strap action. The location follow-up is a saved tag. Granted for Health Connect writes means the required permissions only. Auto sync turns on only after its first export succeeds. All Health Connect writes share one Mutex. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
S6: requests go through one channel and worker, a Sync now waits for a session or a firmware update, stale auto and type requests are dropped, only an auto failure triggers an immediate retry, dumpRaw takes its turn and never leaves Running. S19: widget refreshes run one at a time, the snapshot reads sync state once, bump uses update. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Update: failures after process death are shown from the saved tag, the tag is reconciled with installer sessions at start and on resume, Installing times out, one Check type, PendingAction.Install always cleared with feedback when installs are denied. Firmware: stale or illegal events are ignored per step, one AccountMode, token kept out of saved state, fields keyed on the account. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ngs after End Discard is one DAO transaction. Start rolls back if it fails half way and honours a missing GPS. Readings after the last flush are dropped, the loop flushes under the lock, and a failed restore is retried. Starting a workout no longer overrides Disconnect. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…cap sent flag (S15, S23) Alarms: write results close the sheet only on success, queued refresh, Loading/Failed/Loaded read state. Share card: photo state, saveable result. Sleep detail: saveable sheets, Undo only after delete shows. Backups: one DataJobs lock and a snapshot file per call. Recap marked sent only after it is shown. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…connection facts, find strap start order Background connects never clear the user's Disconnect and read it on the lane. Live HR follows reasons, the connection and firmwareUpdating in one ordered coroutine. NotPaired follows the paired flow, Forget clears the old strap's facts, and Find strap is set before its start goes out. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Two overrides returned Boolean where the interface wants Unit, a connect test counted log lines after virtual time while the connect reads the paired strap on a real thread, the share photo test built a Compose bitmap Robolectric can't, and detekt's new findings (long lines, three LaunchedEffects that only set state, and two complexity rules). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Develop's Zepp parity work rewrote sync, connect, live heart rate and workout traffic. - SyncCoordinator: develop's version, which already queues and runs one sync at a time. Group C's SyncPlan and its test are dropped. - LiveHeartRateStream: keeps the single coroutine that owns the stream, with develop's per-screen consumers in place of the effort watch. - StrapManager: develop's connect order plus clearing the last connection's battery and firmware. The wear poll is gone as on develop. - StrapCommands: develop's per-connection alarm caps, still cleared on Forget. - Chinese strings for the five strings wave 1 added. - The firmware install state test is ignored while firmware updates are off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reconnect resend acted on every Connected value, and a battery or charging change is a new one, so each sent the config and state again. Zepp sends it at the workout start (xbc.k) and then only on AUTH_SUCCESS (rbc via yfk); its battery callback sends nothing. It now follows the change into Connected, which the start still sends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A type whose retries ran out, or that hit the cyclic stop, after some chunks counted as ok, so the sync ended Done with that type short. Zepp's type result is its last exchange's status (l59.f, ixi.a), so the type fails and the sync ends with an error. The chunks that came first are still stored and the cursor moves past them, as in Zepp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wn for good, Offer calories again Location and notifications turned down for good get the Bluetooth dialog with its settings button. A notifications denial is now recorded from the Bluetooth ask and checked at workout start. The Health Connect page offers calories again, asking for just those permissions, only while they are not granted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed per part, start returns a result A failed End sets Recording.endFailed and the live screen shows Not saved yet with Try again (End again). saveFailed is now derived from endFailed and a per-part set (Workout, Sets, Rounds, HeartRate), so one success no longer clears another failure. start() returns Deferred<StartResult>, WorkoutSession and the layer share inProgress, the tile no longer sends Ready during a summary or reads the sport back from its subtitle, and a GpsState flow says Off, Searching, Fixed or Unavailable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he picked day is saved DayViewModel builds one DayScreenState from one flatMapLatest on the shown day, so the day, Recovery (Loading, Ready or Failed), Healthspan, usual steps and activity carry the same date and start empty on a switch. The picked day goes in SavedStateHandle. The per-screen date checks are gone, and Sleep detail no longer shows No night before load. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…fter restore, Ready cleared on start WorkoutNotifier (app scope) owns Saved and the Keep recording cancel. The notice can no longer be cancelled by the session's late clear after the service's refusal. Undo only applies to the end it was posted for. End keeps its confirmation until end() finishes. START_STICKY follows the restored state and drops once nothing is in progress. Ready and Choose close whenever the session leaves Idle. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…as a state, companion prompt cancel only hides the offer S5: SyncCoordinator persists the last full sync and the failing-since time. The header, the Strap page and the widgets read that one status. A push sync no longer moves the Synced time, and busy now covers the work after a sync. S12: ConnectionState.BluetoothOff with a Turn on action on the Strap page, the notification and widgets. Companion: Back on Android's prompt hides the offer for now, a real failure falls back to the battery setting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- DayViewModel keeps its profile flow as a property, which the new per-day flows read, and names the 800 ms settle. - StrapService starts itself with runCatching outside a coroutine, and the sticky check is split for detekt. - NavRequestsEffect collects with the lifecycle and closes Ready in a SideEffect. - The two older day tests read the single screen state. - The sync failure time is left out of backups, as the last sync time is. - Line length and two suppressions with reasons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A workout that ended with the app behind left the strap pushing steps, since notify was only set on visibility changes and connects. Zepp's RealtimeStepService turns it off on a step push (07, its mgk event) when the app is behind and no phone GPS workout runs, at most once per 1.5 s (yt00.a, yt00.j). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both lived only in memory, so a process death cut a rest short by the +10 s taps and dropped the live kcal, which never goes down. They are kept in settings for the recording workout, keyed on its start, and read back on restore. The end question and "in a car" still start afresh, so a restart doesn't ask at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DayViewModel: wave 2's per-day activity flow with main's strip dots. ScoreDetail: main's held day page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aceholder Main's detail pages kept the last day's page up to 4 s, undimmed, so another day's numbers stood under the new date. One rule now covers Today and the details: a refresh of the same day keeps its value, another day keeps the last one dimmed for at most 300 ms, then the placeholder, and a failed day holds nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ger stack S11: a STOP or ABANDON the strap never got (out of range, Bluetooth off) left its session running, and its frames then led the live heart rate. The session keeps the unsent end and sends it once on the next connect with nothing recording; a new START replaces it. Seen and fixed on the strap (3.27.0.1) 2026-11-11. S21: two quick taps on You and the strap pill stacked [You, Strap], so Back went to You. The two root pages now replace each other; pages opened from a row still stack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| /** Where the day's rows are worked into its state, off the main thread (audit C7). */ | ||
| private val work: CoroutineDispatcher = Dispatchers.Default, | ||
| /** Keeps the day picked, so a restore reopens the same day. */ | ||
| private val saved: SavedStateHandle = SavedStateHandle(), |
| /** Where the day's rows are worked into its state, off the main thread (audit C7). */ | ||
| private val work: CoroutineDispatcher = Dispatchers.Default, | ||
| /** Keeps the day picked, so a restore reopens the same day. */ | ||
| private val saved: SavedStateHandle = SavedStateHandle(), |
sayed0am
added a commit
that referenced
this pull request
Nov 11, 2026
Brings in the state machine fixes (#63). Health Connect keeps develop's rule that only the needed permissions decide, with the optional ones now calories, breathing rate and VO2 max, offered again from the Health Connect page. Strap workouts are dropped under the same write lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes the implicit state machines from the 2026-11-07 review (findings S1 to S23, plus N1 to N11 from the Zepp parity rewrite). State spread over flags and side fields now has one owner and one set of transitions, and the ones that touch the strap follow Zepp 10.10.5.
Two waves of fix groups, merged here, with develop and main (3.0.4) merged in.
Connection and strap
yt00.Workouts
Sync and history
l59.f.Screens and navigation
Checked
detektDebugandprotocol:detektMainpass.🤖 Generated with Claude Code