Skip to content

Colota - Android GPS Location tracker

fix(profiles): drop the long-interval warning on stationary profiles (#948)

Max Dietrich412cd8d75042
diff --git a/apps/docs/docs/guides/tracking-profiles.md b/apps/docs/docs/guides/tracking-profiles.md
index e7e1f346..b7df5eff 100644
--- a/apps/docs/docs/guides/tracking-profiles.md
+++ b/apps/docs/docs/guides/tracking-profiles.md
@@ -67,7 +67,7 @@ SSID matching is case-insensitive. The name is read when the network changes and
Colota starts the motion detector when the device goes still. It watches accelerometer variance and the hardware significant motion sensor together, so moving again usually ends the profile within seconds rather than at the next fix. That is why the editor hides the deactivation delay here.
-The sensor is not a guarantee. It can miss a slow, gentle start, and not every device has the hardware sensor that can wake a sleeping phone. If it does not notice you starting to move, the profile ends only once GPS reports movement, which at a long interval means waiting for the next fix. That is what the editor warns about above 60 seconds.
+The sensor is not a guarantee. It can miss a slow, gentle start, and not every device has the hardware sensor that can wake a sleeping phone. If it does not notice you starting to move, the profile ends only once GPS reports movement, which at a long interval means waiting for the next fix.
Stationary profiles always use a **0m** distance filter and ignore the setting. Fixes taken in one spot sit a few meters apart, so anything larger would drop the points the profile is there to record.
diff --git a/apps/mobile/src/constants/index.ts b/apps/mobile/src/constants/index.ts
index 202800b8..d5778ee8 100644
--- a/apps/mobile/src/constants/index.ts
+++ b/apps/mobile/src/constants/index.ts
@@ -82,9 +82,6 @@ export const GEOFENCE_ZOOM_PADDING = [80, 80, 80, 80] as const
export const MAP_ANIMATION_DURATION_MS = 400
export const LOADING_INDICATOR_DELAY_MS = 200
-// Doze batches motion sensors past this; longer Stationary intervals risk missed trip starts.
-export const STATIONARY_MAX_INTERVAL_SECONDS = 60
-
export const PROFILE_CONDITIONS: {
type: ProfileConditionType
labelKey: TranslationKey
diff --git a/apps/mobile/src/i18n/locales/en.json b/apps/mobile/src/i18n/locales/en.json
index ca2b990c..5ec464a5 100644
--- a/apps/mobile/src/i18n/locales/en.json
+++ b/apps/mobile/src/i18n/locales/en.json
@@ -758,7 +758,6 @@
"profileEditor.speed": "Speed",
"profileEditor.speed.hintAbove": "At least 1 {{unit}}. Applies while your average speed is above it.",
"profileEditor.speed.hintBelow": "At least 1 {{unit}}. Applies while your average speed is below it.",
- "profileEditor.stationaryLong": "Longer than {{max}} s may leave the first {{duration}} of a trip unrecorded",
"profileEditor.sync.hint": "Replaces the {{interval}} from Tracking & sync while this profile is active · shorter means more wake-ups",
"profileEditor.titleEdit": "Edit profile",
"profileEditor.titleNew": "New profile",
diff --git a/apps/mobile/src/i18n/locales/es.json b/apps/mobile/src/i18n/locales/es.json
index d406da06..34ca2f0d 100644
--- a/apps/mobile/src/i18n/locales/es.json
+++ b/apps/mobile/src/i18n/locales/es.json
@@ -758,7 +758,6 @@
"profileEditor.speed": "Velocidad",
"profileEditor.speed.hintAbove": "Al menos 1 {{unit}}. Se aplica mientras tu velocidad promedio esté por encima.",
"profileEditor.speed.hintBelow": "Al menos 1 {{unit}}. Se aplica mientras tu velocidad promedio esté por debajo.",
- "profileEditor.stationaryLong": "Más de {{max}} s puede dejar sin registrar los primeros {{duration}} de un trayecto",
"profileEditor.sync.hint": "Reemplaza el {{interval}} de Seguimiento y sincronización mientras este perfil esté activo · más corto significa más activaciones",
"profileEditor.titleEdit": "Editar perfil",
"profileEditor.titleNew": "Perfil nuevo",
diff --git a/apps/mobile/src/i18n/locales/zh.json b/apps/mobile/src/i18n/locales/zh.json
index dbf23060..6becda85 100644
--- a/apps/mobile/src/i18n/locales/zh.json
+++ b/apps/mobile/src/i18n/locales/zh.json
@@ -750,7 +750,6 @@
"profileEditor.speed": "速度",
"profileEditor.speed.hintAbove": "至少 1 {{unit}},平均速度高于此值时生效。",
"profileEditor.speed.hintBelow": "至少 1 {{unit}},平均速度低于此值时生效。",
- "profileEditor.stationaryLong": "超过 {{max}} 秒可能导致行程开始的 {{duration}} 未被记录",
"profileEditor.sync.hint": "此配置活动时替换“跟踪和同步”中的 {{interval}} · 越短表示唤醒次数越多",
"profileEditor.titleEdit": "编辑配置",
"profileEditor.titleNew": "新配置",
diff --git a/apps/mobile/src/screens/ProfileEditorScreen.tsx b/apps/mobile/src/screens/ProfileEditorScreen.tsx
index dc7389f1..961e5917 100644
--- a/apps/mobile/src/screens/ProfileEditorScreen.tsx
+++ b/apps/mobile/src/screens/ProfileEditorScreen.tsx
@@ -35,7 +35,6 @@ import { parseWholeNumber, wholeNumberError } from "../utils/settingsValidation"
import {
PROFILE_CONDITIONS,
SAVE_SUCCESS_DISPLAY_MS,
- STATIONARY_MAX_INTERVAL_SECONDS,
defaultProfileDelays,
size,
space
@@ -401,14 +400,6 @@ export function ProfileEditorScreen({ navigation, route }: RootScreenProps<"Prof
error={errorOf("interval")}
message={noteOf("interval")}
/>
- {isStationary && profile.interval > STATIONARY_MAX_INTERVAL_SECONDS && (
- <FieldMessage variant="warning" style={styles.warning}>
- {t("profileEditor.stationaryLong", {
- max: STATIONARY_MAX_INTERVAL_SECONDS,
- duration: formatDuration(profile.interval)
- })}
- </FieldMessage>
- )}
{isStationary ? (
<SettingRow disabled label={t("trackingSync.distance")} hint={t("profileEditor.distance.stationary")}>
<Text style={[styles.figure, { color: colors.textDisabled }]}>0 {distanceUnit}</Text>
@@ -514,7 +505,6 @@ const styles = StyleSheet.create({
field: { paddingBottom: space.lg },
numInput: { width: size.numericField },
figure: { fontSize: fontSizes.input, ...fonts.medium, fontVariant: ["tabular-nums"] },
- warning: { marginTop: -space.sm, marginBottom: space.lg },
pickerTop: { paddingTop: space.lg },
save: { marginTop: space.xl }
})
diff --git a/apps/mobile/src/screens/__tests__/ProfileEditorScreen.test.tsx b/apps/mobile/src/screens/__tests__/ProfileEditorScreen.test.tsx
index 7da0d536..2ae2fd0f 100644
--- a/apps/mobile/src/screens/__tests__/ProfileEditorScreen.test.tsx
+++ b/apps/mobile/src/screens/__tests__/ProfileEditorScreen.test.tsx
@@ -321,14 +321,13 @@ describe("ProfileEditorScreen", () => {
).toBeTruthy()
})
- it("warns above 60 s without blocking Save", () => {
- const { getByTestId, getByText, queryByText } = renderNew()
+ it("accepts a long heartbeat interval without a warning, since that is what the profile is for", () => {
+ const { getByTestId, queryByText } = renderNew()
fireEvent.press(getByTestId("condition-stationary"))
- expect(queryByText(/may leave the first/)).toBeNull()
- fireEvent.changeText(getByTestId("interval-input"), "300")
+ fireEvent.changeText(getByTestId("interval-input"), "1800")
- expect(getByText("Longer than 60 s may leave the first 5 min of a trip unrecorded")).toBeTruthy()
+ expect(queryByText(/unrecorded/)).toBeNull()
expect(getByTestId("save-profile-btn").props.accessibilityState.disabled).toBe(false)
})
})
diff --git a/fastlane/metadata/android/en-US/changelogs/52.txt b/fastlane/metadata/android/en-US/changelogs/52.txt
index 738828db..80d20319 100644
--- a/fastlane/metadata/android/en-US/changelogs/52.txt
+++ b/fastlane/metadata/android/en-US/changelogs/52.txt
@@ -5,4 +5,5 @@
- A setup link applied while tracking now takes effect at once instead of after the next start
- After a rate limit, sync waits as long as the server asks and Sync now says so
- Tracking profiles can switch on Wi-Fi, either any network or one you name
+- The profile editor no longer warns about a Stationary interval above 60 seconds
- No more lost points after a Wi-Fi drop at home