Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
c8f80bc
finalized day lookup scanned every finalized bundle for the imported …
abdulsaheel Oct 28, 2026
807121e
the substrate archive kept a year of raw readings with no way to chan…
abdulsaheel Oct 28, 2026
9bcc898
add a compact database action to the data settings
abdulsaheel Oct 28, 2026
d90f010
undecodable frames cost ~9 KB each in raw_archive
abdulsaheel Oct 28, 2026
89a9823
freeze golden compared the new day_result.imported flag as output
abdulsaheel Oct 28, 2026
742c42f
every heavy pass re-derived each pending day even with no new data
abdulsaheel Oct 28, 2026
ac52c7f
compact pruned against its own day list instead of the derive scope
abdulsaheel Oct 28, 2026
042cc30
backup folder test looked for its result card without scrolling to it
abdulsaheel Oct 28, 2026
0ac2e35
store the quiet snapshot before the baseline signature, recheck for a…
abdulsaheel Oct 28, 2026
feff2df
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 28, 2026
5ac1268
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 28, 2026
737fcdc
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 28, 2026
cbd3835
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 28, 2026
d6e1c69
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 28, 2026
07f7dee
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 29, 2026
2db74bb
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-speed
abdulsaheel Oct 29, 2026
f7d513a
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 29, 2026
26a1300
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-speed
abdulsaheel Oct 29, 2026
ba6dd53
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-speed
abdulsaheel Oct 29, 2026
154c04e
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-speed
abdulsaheel Oct 29, 2026
d75b895
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-speed
abdulsaheel Oct 29, 2026
6490708
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-speed
abdulsaheel Oct 29, 2026
1cb70d5
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-speed
abdulsaheel Oct 30, 2026
03835d9
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
9f4c16e
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
3f3f717
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
9d2701f
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
72f383c
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
ee00d62
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
a4d5a2d
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
5d64a89
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
d5a9b9d
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
c823c11
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
b99189e
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
6e5c808
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
7488866
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
482f29c
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
ed3a2eb
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 30, 2026
1112aeb
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 31, 2026
993d1bf
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 31, 2026
1fafa26
Merge branch 'fix/ui-and-translations' into fix/db-size-and-sync-spee…
abdulsaheel Oct 31, 2026
43fce5b
Merge remote-tracking branch 'origin/main' into fix/db-size-and-sync-…
abdulsaheel Oct 31, 2026
5830ec7
keep the raw archive view and index steps atomic
abdulsaheel Oct 31, 2026
09c4cd9
keep a year of archive for installs that already had one
abdulsaheel Oct 31, 2026
8fdafd8
a fingerprint read or write that fails no longer fails the day
abdulsaheel Oct 31, 2026
bda8f16
stop moving the old archive when a band offload starts
abdulsaheel Oct 31, 2026
359b85a
measure the archive window from the archive when there are no band rows
abdulsaheel Oct 31, 2026
36241f9
never cache a partial derive as unchanged
abdulsaheel Oct 31, 2026
0397aff
run the archive window check only on this phone's database, and never…
abdulsaheel Oct 31, 2026
2335529
keep a year for any database or backup from before the 90-day default
abdulsaheel Oct 31, 2026
897bb8a
count beat-only records as history when picking the archive window
abdulsaheel Oct 31, 2026
0796dbf
name the archive view so an older build can still open the database
abdulsaheel Oct 31, 2026
872ff98
never adopt a backup's archive setting over live readings
abdulsaheel Oct 31, 2026
2648925
read no setting as a year until the window check has run
abdulsaheel Oct 31, 2026
24e1208
give an old archive table its device column before moving it
abdulsaheel Oct 31, 2026
8bb0814
check the partial-derive fingerprint in its own lighter test
abdulsaheel Oct 31, 2026
ce08ee8
Merge branch 'main' into fix/db-size-and-sync-speed
abdulsaheel Oct 31, 2026
3f762a5
give the archive move fifteen seconds only on heavy passes
abdulsaheel Oct 31, 2026
1a83221
read a wearable's archive straight off its tables for the day signature
abdulsaheel Oct 31, 2026
94b43db
say the archive window counts back from the latest reading
abdulsaheel Oct 31, 2026
8999e8c
restart an unfinished archive replay after a VACUUM
abdulsaheel Oct 31, 2026
a37c8b3
read the WAL checkpoint's busy flag after a compaction
abdulsaheel Oct 31, 2026
24640a5
say about, since the archive window drops whole days
abdulsaheel Oct 31, 2026
e582744
run the automatic vacuum under the derive latch
abdulsaheel Oct 31, 2026
00abfda
finish a blocked WAL truncation at the next derive
abdulsaheel Oct 31, 2026
4f157ea
let a heavy pass wait for its disk reclaim before the next job
abdulsaheel Oct 31, 2026
45cb95c
leave a blocked WAL truncation to sqlite
abdulsaheel Oct 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ object NativeChannels {
private const val DEVICE_ACTIONS_CHANNEL = "openstrap/device_actions"
private const val ANDROID_BG_CHANNEL = "openstrap/android_background"
private const val BLE_NATIVE_CHANNEL = "openstrap/ble_native"
private const val STORAGE_CHANNEL = "openstrap/storage"
const val TASKER_CHANNEL = "openstrap/tasker"
const val ACTION_DOUBLE_TAP = "wtf.openstrap.openstrap_edge.DOUBLE_TAP"
private const val TASKER_TOKEN_KEY = "tasker_auth_token"
Expand Down Expand Up @@ -183,6 +184,24 @@ object NativeChannels {
}
}

// Free space on the volume holding the database, for "Compact database".
MethodChannel(engine.dartExecutor.binaryMessenger, STORAGE_CHANNEL)
.setMethodCallHandler { call, result ->
when (call.method) {
"freeBytes" -> {
val path = call.argument<String>("path") ?: app.filesDir.path
result.success(
try {
android.os.StatFs(path).availableBytes
} catch (e: IllegalArgumentException) {
null
}
)
}
else -> result.notImplemented()
}
}

// Band-gesture actions. All no-risk OS APIs: media-key dispatch (works for any
// player, no permission), system media volume, ringtone + vibrate, torch.
MethodChannel(engine.dartExecutor.binaryMessenger, DEVICE_ACTIONS_CHANNEL)
Expand Down
36 changes: 36 additions & 0 deletions ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ import CoreMotion
if let registrar = registry.registrar(forPlugin: "ConfigBridge") {
ConfigBridge.register(messenger: registrar.messenger())
}
// Free space on the volume holding the database, for "Compact database".
if let registrar = registry.registrar(forPlugin: "StorageBridge") {
StorageBridge.register(messenger: registrar.messenger())
}
// The phone's OWN step count (CMPedometer), not HealthKit's multi-writer
// aggregate. See lib/health/phone_pedometer.dart.
if let registrar = registry.registrar(forPlugin: "PedometerBridge") {
Expand Down Expand Up @@ -123,6 +127,38 @@ import CoreMotion
}
}

enum StorageBridge {
private static let channelName = "openstrap/storage"

static func register(messenger: FlutterBinaryMessenger) {
let channel = FlutterMethodChannel(name: channelName, binaryMessenger: messenger)
channel.setMethodCallHandler { call, result in
switch call.method {
case "freeBytes":
// Bytes a write can actually use. The "important usage" figure counts
// purgeable space iOS frees on demand, which is what a VACUUM sees.
let path = (call.arguments as? [String: Any])?["path"] as? String
?? NSHomeDirectory()
let url = URL(fileURLWithPath: path)
do {
let values = try url.resourceValues(
forKeys: [.volumeAvailableCapacityForImportantUsageKey])
if let bytes = values.volumeAvailableCapacityForImportantUsage {
result(NSNumber(value: bytes))
return
}
let attrs = try FileManager.default.attributesOfFileSystem(forPath: path)
result(attrs[.systemFreeSize] as? NSNumber)
} catch {
result(nil)
}
default:
result(FlutterMethodNotImplemented)
}
}
}
}

enum ConfigBridge {
private static let channelName = "openstrap/ios_config"

Expand Down
4 changes: 3 additions & 1 deletion lib/coach/coach_db.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ class CoachDb {
'workout_suggestions', 'workout_route', 'live_coverage',
'session_score_mask', 'session_sensor',
// raw / decoded substrate
'raw_records', 'raw_archive', 'decoded_onehz', 'decoded_rr', 'samples',
'raw_records', 'raw_archive', 'raw_archive_frames', 'raw_archive_legacy',
'raw_archive_view',
'decoded_onehz', 'decoded_rr', 'samples',
'events', 'band_events', 'band_battery', 'substrate_archive',
'device_coverage', 'signal_priority',
// WHOOP MG ECG. `ecg_reading` is a base table of an allowed view, so the
Expand Down
Loading
Loading