Skip to content
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

Add null start timestamp check for metric events #857

Merged
merged 2 commits into from
Apr 13, 2018

Conversation

danesfeder
Copy link
Contributor

Closes #827

I haven't been able to reproduce this issue. In the ticket, it seems an arrival event is being fired as soon as navigation begins and before we have a start timestamp (some distance has been traveled).

This PR will fix the immediate issue, but I'm interested if there is a deeper issue. The only way I can imagine this occurring is if a DirectionsRoute is provided that's very short, where the first step is the arrival step. I'm hoping the two developers that reproduced this will provide more context in #827.

@danesfeder danesfeder added bug Defect to be fixed. topic: telemetry labels Apr 12, 2018
@danesfeder danesfeder added this to the v0.13.0 milestone Apr 12, 2018
@danesfeder danesfeder self-assigned this Apr 12, 2018
Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting here that this won't be needed after #697 lands because it's now dealt internally by the new Events library.

@@ -216,4 +217,11 @@ private static void updateRouteProgressSessionData(MetricsRouteProgress routePro
private static Location[] convertToArray(List<Location> locationList) {
return locationList.toArray(new Location[locationList.size()]);
}

private static Date checkNullStartTimestamp(SessionState sessionState) {
if (sessionState.startTimestamp() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor detail: Why not the other way around? Why not using a guard clause instead? In the exceptional case (sessionState.startTimestamp() is null) return new Date() and in the normal case return sessionState.startTimestamp(). IMO it makes clearer the intention of the method.

@vicobz
Copy link

vicobz commented Apr 13, 2018

The only way I can imagine this occurring is if a DirectionsRoute is provided that's very short, where the first step is the arrival step

@danesfeder Given certain constraints related to my own backend's data, I had to test several times to fetch very short navigation routes with a starting point almost identical to that of arrival. So, as you said in your first post, this could be the cause!

@danesfeder danesfeder merged commit 5476d10 into master Apr 13, 2018
@danesfeder danesfeder deleted the dan-null-timestamp branch April 13, 2018 15:18
@danesfeder danesfeder mentioned this pull request May 3, 2018
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defect to be fixed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NullPointerException thrown by Navigation Telemetry services
3 participants