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

[DAT-41] Fix transitions #1192

Merged
merged 2 commits into from
Mar 22, 2024
Merged

[DAT-41] Fix transitions #1192

merged 2 commits into from
Mar 22, 2024

Conversation

paultranvan
Copy link
Contributor

### ✨ Features

*

### πŸ› Bug Fixes

* Prevent missing trips because of overlapping transitions

### πŸ”§ Tech

*

Checklist

Before merging this PR, the following things must have been done if relevant:

  • Tested on iOS
  • Tested on Android
  • Test coverage
  • README and documentation

@paultranvan paultranvan changed the title [DAT-47] Fix transitions [DAT-41] Fix transitions Mar 20, 2024
@@ -292,5 +293,5 @@ export const startOpenPathUploadAndPipeline = async ({
Log('Failed openpath processing: ' + err)
log.error(err)
}
return
return uploadedCount
Copy link
Contributor

Choose a reason for hiding this comment

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

you should update the jsdoc to reflect that change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, it's done

@paultranvan paultranvan force-pushed the fix-transitions branch 2 times, most recently from 33bd281 to 8972e71 Compare March 21, 2024 14:48
Consider this scenario:
- A location point P1 is produced at 12:00:00 (T1), the last of a trip.
- An upload is done, with the stop transitions set at T1 + 1s =
  12:00:01
- P2 is produced at 12:00:01 (T2), the first of new trip
- At upload time, the start transitions will be set at T2 - 1s =
  12:00:00

Then, the start transition timestamp of the new trip will be before the stop
transition of the previous trip, which is not possible, and will be
discarded by the server, which will result in a missing trip.

To solve this, we now add/substract 1ms to the transitions w.r.t. to the
first or last location point. This should prevent overlapping transitions,
as long as locations between 2 trips are not produced in the same ms
@paultranvan paultranvan merged commit bd7eace into master Mar 22, 2024
1 check passed
@paultranvan paultranvan deleted the fix-transitions branch March 22, 2024 10:04
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