Skip to content

Save offline Apple workouts and score samples off the main actor - #2760

Open
AlexSchmidt1999 wants to merge 5 commits into
ryanbr:mainfrom
AlexSchmidt1999:codex/upstream-offline-history-oct10
Open

AlexSchmidt1999 wants to merge 5 commits into
ryanbr:mainfrom
AlexSchmidt1999:codex/upstream-offline-history-oct10

Conversation

@AlexSchmidt1999

@AlexSchmidt1999 AlexSchmidt1999 commented Oct 10, 2026 •

Copy link
Copy Markdown

What this PR does

An intentional workout without live HR or GPS is discarded. Sessions with at least one active minute now save their duration, and later strap history can fill HR, calories, and Effort.

A local 14-day ledger identifies recorded sessions and their pauses without changing the database schema. Scoring reuses the existing HR union and formulas, excludes paused windows, and only updates improved metrics. Explicit user edits keep precedence. Stream fingerprints are committed after successful writes, allowing failed updates to be retried.

This changes the Apple recording path. Android is unchanged.

This PR is stacked on the durable training save and pause changes. It needs a rebase after that PR merges. Review this feature without the dependency.

Type of change

  • New feature

How it was tested

SQLite tests cover missing HR, save failure and retry, successive sync chunks, pause exclusion, device/session matching, retention, and manual metric overrides. A physical phone-away/reconnect test still needs to be recorded.

The focused macOS tests and iOS Release build passed on this PR head. Source hygiene and iOS translation checks passed too.

Checklist

  • Generated projects, build output, and credentials are excluded.
  • No new dependencies or destructive strap commands.

Installed-source update, October 16

Accepted samples now queue immutable snapshots for scoring and encoding on a utility-priority worker. Session identity and revision checks protect the result merge. Start, pause, resume and background transitions bank the latest raw window synchronously. The PR includes the installed worker, save-retry fixtures and synthetic Release benchmark.

Review head: 2875f17c84bd. A local merge of the PRs reproduces the installed iPhone commit f88a1e12: 1,182 of 1,183 Apple product files are byte-identical; the remaining file uses the existing NoopMetrics.space3 token for the same 12-point spacing. The combined macOS build and iPhone Release build pass, including widgets and Watch components. The macOS run completes 2,352 app tests with three skipped and zero failures.

@AlexSchmidt1999 AlexSchmidt1999 changed the title Save offline Apple workouts and fill metrics after sync Save offline Apple workouts and score samples off the main actor Oct 16, 2026
@AlexSchmidt1999

Copy link
Copy Markdown
Author

I am using NOOP 12.1.0 Release build 456 on my iPhone 17 Pro Max, and the app runs very smoothly in everyday use.

This PR is included in that combined build, together with my other Apple changes and the performance fixes from #2724 by @UtkuDenizAltiok and #2705 by @kavemang. The installed source is d67cceb5.

Both Apple builds and the local app, analytics, database and Python test suites passed for this combined build.

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.

2 participants