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 periodic refresh #1855

Merged
merged 1 commit into from
Apr 2, 2019
Merged

Add periodic refresh #1855

merged 1 commit into from
Apr 2, 2019

Conversation

Guardiola31337
Copy link
Contributor

@Guardiola31337 Guardiola31337 commented Apr 1, 2019

Description

Adds periodic refresh functionality

What's the goal?

Add a polling mechanism to refresh traffic and ETAs on a regular basis (5 minutes) when in navigation

How is it being implemented?

RouteRefresher includes a check method which 👀 if the refresh interval has been met. This is checked within RouteProcessorRunnable and if true, RouteRefresher#refresh is called which calls RouteRefresh#refresh and updates a flag to prevent refresh from being called multiple times until the route response is received. At this point, the refreshed route is passed in via mapboxNavigation.startNavigation(directionsRoute, DirectionsRouteType.FRESH_ROUTE); which updates traffic and ETAs data. Finally, everything is reset in preparation for the next interval check.

TODOs

How has this been tested?

  • Added "debug" logs to ensure that refresh calls were done on a regular basis / specified interval and data was refreshed properly 👀 that the route line was updated

Checklist

  • I have tested locally / staging (including SNAPSHOT upstream dependencies if needed)
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@Guardiola31337 Guardiola31337 added ⚠️ DO NOT MERGE PR should not be merged! feature New feature request. topic: directions labels Apr 1, 2019
@Guardiola31337 Guardiola31337 added this to the v0.34.0 milestone Apr 1, 2019
@Guardiola31337 Guardiola31337 self-assigned this Apr 1, 2019
@@ -680,7 +680,8 @@ public NavigationRoute build() {
.voiceInstructions(true)
.bannerInstructions(true)
.roundaboutExits(true)
.eventListener(eventListener);
.eventListener(eventListener)
.enableRefresh(true);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Enabling refresh by default

Copy link
Contributor

@danesfeder danesfeder left a comment

Choose a reason for hiding this comment

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

@Guardiola31337 this is looking great, let's add the options you have marked in the TODOs and 🚢

@Guardiola31337
Copy link
Contributor Author

Remaining TODOs were addressed and this is updated and ready for a final round of 👀

@codecov-io
Copy link

Codecov Report

Merging #1855 into master will increase coverage by 0.23%.
The diff coverage is 72.54%.

@@             Coverage Diff              @@
##             master    #1855      +/-   ##
============================================
+ Coverage     33.59%   33.83%   +0.23%     
- Complexity     1015     1026      +11     
============================================
  Files           254      256       +2     
  Lines          8701     8746      +45     
  Branches        660      662       +2     
============================================
+ Hits           2923     2959      +36     
- Misses         5518     5525       +7     
- Partials        260      262       +2

@Guardiola31337 Guardiola31337 added ✓ ready for review and removed ⚠️ DO NOT MERGE PR should not be merged! labels Apr 2, 2019
…c and etas on a regular basis when in navigation
@Guardiola31337 Guardiola31337 merged commit 22f25c3 into master Apr 2, 2019
@Guardiola31337 Guardiola31337 deleted the pg-periodic-refresh branch April 2, 2019 17:03
@Guardiola31337 Guardiola31337 modified the milestones: v0.34.0, v0.35.0 Apr 2, 2019
Guardiola31337 added a commit that referenced this pull request Apr 2, 2019
…c and etas on a regular basis when in navigation (#1855)
Guardiola31337 added a commit that referenced this pull request Apr 2, 2019
…c and etas on a regular basis when in navigation (#1855)
@Guardiola31337 Guardiola31337 mentioned this pull request Apr 12, 2019
11 tasks
Guardiola31337 added a commit that referenced this pull request Apr 12, 2019
…c and etas on a regular basis when in navigation (#1855)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request.
Projects
None yet
3 participants