Starting a new TTVC measurement will now cancel out the previous measurement, if it is still active #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this
While working on tighter integration of TTVC measurements of "soft" navigations, I have ran into an issue. While it is admittedly an edge case it still warrants a fix: when a soft navigation occurs before the measurement has had a chance to complete, the interrupted navigation will not be reported entirely correctly.
The diagram below might help understand the issue:
In this situation:
Along the way, I have also addressed a few edge case scenarios:
NEW_MEASUREMENT
cancellation reason, which is slightly distinct fromNEW_NAVIGATION
.NEW_NAVIGATION
might mean a navigation to an entirely different site; WhileNEW_MEASUREMENT
refers to a new measurement on an existing site.Testing
spa6
, to test for this scenario.yarn:express
and hit thehttp://localhost:3000/test/spa6#
test case. Wait for a hard navigation to complete. Click one of the links, and immediately click another link. You will see that a cancellation of the first soft navigation TTVC measurement will occur before the second soft navigation.