fix: Lock duration in extension task history action text and test cas…#7214
Merged
Conversation
|
Member
|
Test by @manjitapandey in Naxa' dev setup. Merging it to develop branch for further testing |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



…es refactor/fix
What type of PR is this? (check all applicable)
Related Issue
Fixes #6014
Describe this PR
Refactor of #7044
The action text was missing in EXTEND_FOR_MAPPING and EXTEND_FOR_VALIDATION actions which were later introduced.
Previously, all the Task actions and status were same so the based on the current task status the actions were being patched in the action text accordingly. However, in case of extending mapping or validation, the equivalent status weren't there due to which no tasks were being fetched and hence the timestamps was not being patched.
The task is always relocked when the session is expired for mapping or validation. This causes redundant entries for extension in the history table. These redundant entries are recursively deleted and only one entry is patched with the total extended time.
This recursive deletion function is legacy code which was introduced due to race condition creating multiple entries. This handles the multiple redundant entries for extension currently though this relock mechanism needs to be handled.
Ideal scenario for multiple extension of task duration would be, everytime the task is relocked, the extended session is patched and then again the task is locked and extended for the next phase of extension.
The test cases are refactored too as previously, the test cases didn't check the last entry of the task history but instead just checked the task status. Now when it tried to fetch the last entry, the tests that directly updated the status with sql, now didn't find the history entry and hence were refactored accordingly.