forked from Blendman974/faceclaw
38 lines
2.3 KiB
Markdown
38 lines
2.3 KiB
Markdown
# R1 health export
|
|
|
|
Android Settings → Health export uses the existing toggle and text/password
|
|
editors. Export defaults off; URL and API key default empty. Only the API key
|
|
uses AES-GCM with Android Keystore and an AtomicFile in noBackupFilesDir. Keys
|
|
are masked on both glasses and phone. The URL/cursor use shared settings.
|
|
|
|
The matching API/manifests live in Infrastructure/FaceclawHealth and SQL dashboards
|
|
in GrafanaDashboards/Health. Protocol v1 sends normalized HealthSample/SleepSession
|
|
fields with original millisecond timestamps. Batches contain at most 200 records
|
|
and 240 KB. HTTPS is mandatory, redirects are refused, and only HTTP 200 with
|
|
accepted:true advances the cursor. No health content or keys are logged.
|
|
|
|
The exporter reads existing append journals, including revisions to old months,
|
|
without extra BLE pulls. Partial trailing lines are retried. Unresolved sleep
|
|
sessions and sample fixtures are excluded. Replayed data is upserted server-side.
|
|
A new URL/key resets delivery history safely. One batch runs per minute while
|
|
the Android process is alive; this adds no background service or wake lock and
|
|
does not promise synchronization while the app is stopped. Disable preserves
|
|
local history and existing server data. Watch/iOS export is outside this change.
|
|
|
|
Software validation: exporter tests for replay, revisions, failed/malformed
|
|
acknowledgements, redirects, destination/credential edits, fixtures, partial
|
|
records and overlapping requests; full JS suite, TypeScript and Android release
|
|
compilation. API tests additionally cover PostgreSQL rollback and deduplication.
|
|
|
|
Hardware/end-to-end validation remains pending: enable ring health sync, configure
|
|
the deployed URL/key, then compare measured timestamps/values and sleep durations
|
|
with Grafana. Test offline/reconnect, app restart, disable/re-enable and rotated
|
|
keys. Check key masking, log redaction and preservation of other preferences.
|
|
No firmware modification is needed.
|
|
|
|
Companion PRs: [Faceclaw #11](https://git.undefined-dev.fr/Blendman974/faceclaw/pulls/11),
|
|
[Infrastructure #1685](https://git.undefined-dev.fr/Infrastructure/Infrastructure/pulls/1685),
|
|
and [dashboards #6](https://git.undefined-dev.fr/Infrastructure/GrafanaDashboards/pulls/6).
|
|
Combined validation: 1137 JS tests passed, 2 skipped; TypeScript and Android
|
|
release build passed, including all seven native libraries' 16 KiB page check.
|