-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix: OPTIC-1120: Draft lead time incorrectly calculated which can cause annotation lead time to be wrong #6406
Conversation
…se annotation lead time to be wrong
✅ Deploy Preview for label-studio-docs-new-theme ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for heartex-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor tweak for readability otherwise approved
Co-authored-by: yyassi-heartex <[email protected]>
/git merge develop
|
PR fulfills these requirements
[fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made
ex.fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
Change has impacts in these area(s)
(check all that apply)
Describe the reason for change
When the current annotation would be a draft, based on the logic previously there it would assign total accumulated leadTime to both the current draft and any annotations. There was a point in time where the draft and annotation would be loaded into state, and the calculation made here would not properly factor in that drafts accumulate and eventually add the current running total of the draft over to the annotation once submitted. Because of this, we would end up doubling the value stored each time a draft would be saved, and once applied to the annotation.
An example I was able to reproduce was as follows:
The numbers I was able to find just infrequently working through a task with the above steps over the course of 4 hours, was:
It cannot be possible to have a lead time that is larger than the time from which the task was first taken and the first interaction made.
This is how it should be calculating:
Draft Created → 0s DraftLeadTime
Elapsed → 10s
Draft Save → 10s DraftLeadTime
Elapsed → 5s
Draft Save → 15s DraftLeadTime
Draft Submitted → 0 + 15 = 15s LeadTime
Draft Created → 0s DraftLeadTime
Elapsed → 20s
Draft Save → 20s DraftLeadTime
Elapsed → 25s
Draft Save → 45s DraftLeadTime
Draft Submitted → 15 + 45 = 60s LeadTime
The draft values should be rolling up to the annotation it would be converted to on submit, not incorrectly adding all previous annotation values on every draft save.
Does this PR introduce a breaking change?
(check only one)
Which logical domain(s) does this change affect?
(Annotation, Draft, History) Lead Time