Skip to content

Commit 87668c7

Browse files
sprobst76claude
andcommitted
fix(geofence): add bounce protection to prevent fragmented entries
- Ignore EXIT→ENTER or ENTER→EXIT events within 5 minutes of each other - Prevents fragmented work entries caused by GPS fluctuation at zone boundary - User reported entries like 12:03-13:11, 13:11-13:29, etc. all in same mode Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 66875ab commit 87668c7

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ und dieses Projekt folgt [Semantic Versioning](https://semver.org/lang/de/).
1414

1515
---
1616

17+
## [0.1.0-beta.30] - 2026-01-19
18+
19+
### Behoben
20+
- **Zerstückelte Einträge bei Geofence**: Bounce-Protection hinzugefügt
21+
- EXIT→ENTER oder ENTER→EXIT Events innerhalb von 5 Minuten werden ignoriert
22+
- Verhindert fragmentierte Einträge bei GPS-Fluktuation an der Zonengrenze
23+
24+
---
25+
1726
## [0.1.0-beta.29] - 2026-01-15
1827

1928
### Behoben

lib/services/geofence_event_queue.dart

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,24 @@ class GeofenceEventQueue {
5757
// Aktuelle Queue laden
5858
final queue = await getQueue();
5959

60-
// Duplikate vermeiden: Nicht dasselbe Event innerhalb von 30 Sekunden
6160
final lastEvent = queue.isNotEmpty ? queue.last : null;
62-
if (lastEvent != null &&
63-
lastEvent.event == event.event &&
64-
lastEvent.zoneId == event.zoneId &&
65-
event.timestamp.difference(lastEvent.timestamp).inSeconds.abs() < 30) {
66-
return; // Duplikat ignorieren
61+
if (lastEvent != null) {
62+
final timeDiff = event.timestamp.difference(lastEvent.timestamp).inSeconds.abs();
63+
64+
// Duplikate vermeiden: Gleiches Event innerhalb von 30 Sekunden
65+
if (lastEvent.event == event.event &&
66+
lastEvent.zoneId == event.zoneId &&
67+
timeDiff < 30) {
68+
return; // Duplikat ignorieren
69+
}
70+
71+
// Bounce-Protection: EXIT→ENTER oder ENTER→EXIT innerhalb von 5 Minuten ignorieren
72+
// Verhindert zerstückelte Einträge bei GPS-Fluktuation an der Zonengrenze
73+
if (lastEvent.zoneId == event.zoneId &&
74+
lastEvent.event != event.event &&
75+
timeDiff < 300) { // 5 Minuten
76+
return; // Bounce ignorieren
77+
}
6778
}
6879

6980
// Event hinzufügen

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: time_tracker
22
description: Zeiterfassung mit Geofence, Urlaub, Feiertagen & ICS-Sync
3-
version: 0.1.0-beta.29+29
3+
version: 0.1.0-beta.30+30
44
publish_to: 'none'
55

66
environment:

0 commit comments

Comments
 (0)