-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trip end notifications needs to be tweaked to be more meaningful #372
Comments
first, do you see this behavior on android or on iOS? android is a lot more configurable wrt this behavior than iOS I know that @ipsita0012 is on iOS |
@JackBikes if you send me the logs and the rough time that this happened - e.g. "here are the logs, and this happened around 3pm MDT on 12th Aug", I can see what happened and come up with some ideas on how to fix it. |
mine was on iOS |
I think @JackBikes is also on iOS. Maybe this is mainly a problem with iOS? I haven't seen this yet on my iOS test phones, but if somebody sends me logs and times, I'm happy to investigate. |
I am on iOS, just to confirm.
… On Aug 14, 2020, at 10:12 PM, shankari ***@***.***> wrote:
I think @JackBikes is also on iOS. Maybe this is mainly a problem with iOS? I haven't seen this yet on my iOS test phones, but if somebody sends me logs and times, I'm happy to investigate.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
so @JackBikes sent me his logs and I took a look. Many of the trips are correct, but I persistently see a pattern in which we get the VISIT_ENDED and VISIT_STARTED notifications with the same timestamp - e.g.
I have also seen this as part of the MobilityNet dataset (Figure 7.3 (top) and Table 7.4), so it does happen periodically. I can think of a couple of fixes:
Looking at the data from @JackBikes, a reasonable definition of "small delta" would be 1 min. While most of the short lived trips are under a second, I do see this as well
Let's try with one minute and see what happens. |
The problem with (1) is that it the |
We need to be a bit careful about which transitions to check against. If we look more closely at the first example in #372 (comment) We actually got the geofence exit ~ 15 mins before the VISIT_ENDED notification
And then we got a visit started just after that. So comparing
We have two choices - we can either cache the timestamp of the last |
Actually, we do a lot more checking against prior entries in the Delegate, not the state machine, so maybe (1) is actually a better choice. |
Actually, no because we want to preserve all the raw data in case we want to change the logic (e.g. definition of "small delta") later. Generate the transition and deal with it correctly in the FSM by having the new state == currState. |
Implemented and briefly tested in the emulator. Don't actually see this in the real world myself so will wait for @JackBikes to test once I push tomorrow. |
Thanks for the updates, Shankari! Look forward to seeing the updates.
Jack Todd
Director of Communications and Policy, Bicycle Colorado
Pronouns: he/him/his
1525 Market Street, Suite 100
Denver, CO 80202
Cell: (303) 523-4231
bicyclecolorado.org
<https://www.bicyclecolorado.org/bike-news/social-justice/>
…On Tue, Aug 25, 2020 at 12:13 AM shankari ***@***.***> wrote:
Implemented and briefly tested in the emulator. Don't actually see this in
the real world myself so will wait for @JackBikes
<https://github.com/JackBikes> to test once I push tomorrow.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#372 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQTXBKOZRMUUAWVCKKHFXJTSCNJB3ANCNFSM4HFNMD6A>
.
|
As feared, this fixed caused some real fixes to be missed: The trip to the park was sort of fine, except that it actually took closer to 5 mins and not 20.
Then, the trip departure was detected at 12:23, and we received the
But it was too soon after the
|
Couple of questions:
|
One fairly simple workaround is to treat a very quick |
Because they are not enabled in the crontab. Duh!
Because on iOS, due to the distance filter, we don't currently check for regular trip end as part of the location callback. We only check it as part of the silent push notification callback, which, of course, is not invoked because of the lack of crontab.
|
Testing this: test phone 3, v0.0.4 |
Sometimes, we get a `VISIT_STARTED` within a second after a `VISIT_ENDED`. Note that the `VISIT_ENDED` is actually delayed significantly although the timestamp in the visit notification is fairly close. The notification was generated 7 minutes after the geofence exit, which is itself generated a few minutes after the actual trip start. ``` 686,1597146582.0006099,2020-08-11T05:49:42.000610-06:00,Received platform-specific notification T_EXITED_GEOFENCE 715,1597147042.3582,2020-08-11T05:57:22.358200-06:00,"Received visit notification = <+39.73087073,-105.03116972> +/- 92.76m (2020-08-11 03:44:32 +0000 to 2020-08-11 11:50:19 +0000)" 724,1597147042.39379,2020-08-11T05:57:22.393790-06:00,"Received visit notification = <+39.72744342,-105.03121412> +/- 89.09m (2020-08-11 11:50:20 +0000 to -)" ``` In this fix, we detect whether the resulting `VISIT_STARTED` is invalid because it is too close to a `VISIT_ENDED` and if so, we silently ignore the transition and don't change the FSM state. This is a potential fix for e-mission/e-mission-docs#372
Check back in TRIP_END mins and see if the trip actually ended or not e-mission/e-mission-docs#372 (comment) Testing done: - Doesn't crash anything - Unsure if it fixes anything, since we haven't run into the situation since Need more testing, but checking this in so we can get started on the next set of changes.
@asiripanich reports in e-mission/e-mission-phone#517 that
@ipsita0012 also reports similar issues
Let's use this issue to track what is going on and whether we can add simple configurable checks to the transition notification code to reduce the incidence of these false positives
The text was updated successfully, but these errors were encountered: