Strange geofence behavior after upgrade to 5.8

Victor Butler9 months ago

I am experiencing a strange behavior with geofences after the 5.8 upgrade.

After the creation of a new geofence, I am getting a Geofence Enter notification for the first data record sent by the device.

Is this normal?

Anton Tananaev9 months ago

Why is it not normal and what are you expecting?

Victor Butler9 months ago

Before the upgrade, when creating a geofence while the device was inside the geofence area, the Geofence Enter notification was sent only after the device exits and then enters the geofence.
Now the geofence enter event is triggered even if the device haven't moved.
Basically, geofence created with the device inside -> Geofence Enter notification triggered upon receiving the next data packet.

Anton Tananaev9 months ago

The new behavior sounds correct to me.

Victor Butler9 months ago

Well, this is not right. It's doesn't make much sense from user perspective to receive an event with the device stationery inside the geofence.
The event should be trigged under two conditions (like it was before):

  • Device is outside and enters geofence
  • Device is inside and exists geofence

Is there a way to filter out this "redundant" event or maybe even cancel it altogether?

Anton Tananaev9 months ago

No.

Victor Butler9 months ago

Ok, so the server gets a data record after the geofence is activated - it sends an event.
How does it "know" not to send a second event after receiving the second data record? Because the geofenceids from the previous row in tc_positions already contains that same geofence id?
Or is the logic different?

Anton Tananaev9 months ago

Yes, it checks the geofence in the last position.

Victor Butler9 months ago

Well, then there needs to be an additional operation adding or removing the geofence to the last positions record at the time the geofence is added/removed. Otherwise the purpose is defied. If I remove a geofence and then receive an event "Geofence exit" 5 hours later, I am going to wonder what's wrong.

I don't think there is an API call to make changes to the positions records, am I correct?

Victor Butler9 months ago

So after some more testing, it's only the geofence enter event which is generated incorrectly. Geofence exit does not generate an extra event after the geofence is removed. Just FYI in case it helps someone else to understand the new setup.