From 2593151ca2c67256442ad25b074504e3ecd3371f Mon Sep 17 00:00:00 2001 From: Lena Date: Wed, 1 Jul 2026 00:00:00 +0000 Subject: app: harden sync execution and persisted state Persist config, key blob, and host pin via AtomicFile so an interrupted write cannot corrupt state. Validate the port, clear the host pin when the remote changes, cap imported key size, time out native helpers, and escalate rsync termination to destroyForcibly. Serialize manual and scheduled syncs behind a mutex. Replace the chained one-time jobs with plain periodic work: it survives reboots without a boot receiver and cannot silently die like a broken chain. Costs the sub-15-minute interval, which photo backup does not need. Document the floor and that syncs run on any unmetered network, not only WiFi. --- app/src/test/java/invalid/lena/rsend/ConfigTest.kt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/src/test') diff --git a/app/src/test/java/invalid/lena/rsend/ConfigTest.kt b/app/src/test/java/invalid/lena/rsend/ConfigTest.kt index 51796ba..a63582d 100644 --- a/app/src/test/java/invalid/lena/rsend/ConfigTest.kt +++ b/app/src/test/java/invalid/lena/rsend/ConfigTest.kt @@ -23,4 +23,10 @@ class ConfigTest { fun defaultsForEmptyObject() { assertEquals(Config(), Config.fromJson(JSONObject("{}"))) } + + @Test + fun scheduleUsesWorkManagerMinimum() { + val json = JSONObject("""{"schedule":{"intervalMinutes":1}}""") + assertEquals(Schedule.MIN_INTERVAL_MINUTES, Config.fromJson(json).schedule.intervalMinutes) + } } -- cgit v1.2.3