Skip to content

Kyv navand 918 fix voice instructions#6689

Merged
RingerJK merged 2 commits intomainfrom
kyv-NAVAND-918-fix-voice-instructions
Dec 7, 2022
Merged

Kyv navand 918 fix voice instructions#6689
RingerJK merged 2 commits intomainfrom
kyv-NAVAND-918-fix-voice-instructions

Conversation

@RingerJK
Copy link
Copy Markdown
Contributor

@RingerJK RingerJK commented Dec 6, 2022

Description

Addressing same fix #6684 but for VoiceInstructions

thanks to @VysotskiVadim

@RingerJK RingerJK self-assigned this Dec 6, 2022
@RingerJK RingerJK requested a review from a team as a code owner December 6, 2022 18:56
@RingerJK RingerJK force-pushed the kyv-NAVAND-918-fix-voice-instructions branch from 4df8130 to d505c6c Compare December 6, 2022 18:57
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 6, 2022

Codecov Report

Merging #6689 (4c1dc2d) into main (85be6da) will increase coverage by 0.00%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #6689   +/-   ##
=========================================
  Coverage     72.41%   72.41%           
- Complexity     5404     5405    +1     
=========================================
  Files           764      764           
  Lines         29386    29391    +5     
  Branches       3487     3488    +1     
=========================================
+ Hits          21280    21284    +4     
  Misses         6715     6715           
- Partials       1391     1392    +1     
Impacted Files Coverage Δ
.../navigation/core/trip/session/MapboxTripSession.kt 86.02% <87.50%> (-0.09%) ⬇️

) {
bannerInstructionEvent.invalidateLatestBannerInstructions(latestInstructionWrapper)
lastVoiceInstruction = null
if (lastVoiceInstruction == voiceInstruction) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we now have a case when the index won't be set to null but the voice instruction will.
The index will be null if latestInstructionWrapper is equal to saved one. But latestInstructionWrapper is about banner instruction and index. So can there be the following case:

  1. banner instruction is updated;
  2. index is not updated;
  3. voice instruction is not updated;
  4. we invoke invalidateLatestInstructions;
  5. result: banner instruction is not null, voice instruction is null?

I'm not sure, maybe this just can't happen. just double-checking.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

that actually a good point. It seems not critical for the voice instruction as it's pronounced once.
Let's cut a ticket to address the issue separately. It looks like refactoring task, along with https://github.com/mapbox/mapbox-navigation-android/pull/6689/files#r1041952357

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

cut NAVAND-964

private fun invalidateLatestInstructions(
latestInstructionWrapper: BannerInstructionEvent.LatestInstructionWrapper?
latestInstructionWrapper: BannerInstructionEvent.LatestInstructionWrapper?,
voiceInstruction: VoiceInstructions?,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it right for the index to be wrapped in banner instruction event if it's responsible both for banner and voice instruction?
I'd keep them all together.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The index is taken from BannerInstruction#getIndex and later the SDK re-uses that index value for voice instruction as well. Not sure why it's done so. (the index of voice and banner instruction must be the same, but why it's taken from BannerInstruction#getIndex is not clear)
@LukasPaczos do you have the context?
We can address the issue separately

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

cut NAVAND-964

@RingerJK RingerJK enabled auto-merge (squash) December 7, 2022 12:07
@RingerJK RingerJK merged commit 0c51c9a into main Dec 7, 2022
@RingerJK RingerJK deleted the kyv-NAVAND-918-fix-voice-instructions branch December 7, 2022 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants