-
Notifications
You must be signed in to change notification settings - Fork 0
[Feature] Add optimistic locking based on versions for tasks and task assignments #571
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
Merged
solenuk
merged 17 commits into
dev
from
feature/add-optimistic-locking-based-on-versions-for-tasks-and-task-assignments
Aug 28, 2026
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
330420e
feat: add new migration for task and assignment versioning
solenuk f5908c0
feat: add new exception for stale task versions
solenuk f11bec6
feat: add version field to TaskBody entity
solenuk 9c2fddd
feat: add version field to dtos
solenuk d8c7869
feat: add version check into service methods
solenuk 88e46e4
feat: add new exception for stale assignment version
solenuk e219084
feat: add version field to TaskAssignment entity
solenuk 15d0f60
feat: add version field to dtos
solenuk 24cbf9c
feat: add version check to service methods
solenuk bfe1437
test: update unit tests
solenuk b50d765
docs: update OpenAPI documentation
solenuk cc51e3f
Resolve merge conflicts with dev
solenuk 2c184ed
fix: remove unused import
solenuk 8ac74e8
fix: audit owner changes with updated_at and updated_by fields
solenuk c1aa085
test: update unit tests
solenuk 9e1266a
fix: coderabbitai issue
solenuk 1f78b7e
fix: coderabbitai issue
solenuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
src/main/java/com/itasocialacademy/oitassist/task/config/file.txt
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
11 changes: 11 additions & 0 deletions
11
src/main/java/com/itasocialacademy/oitassist/task/exceptions/StaleTaskVersionException.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package com.itasocialacademy.oitassist.task.exceptions; | ||
|
|
||
| import com.itasocialacademy.oitassist.core.enums.ErrorCode; | ||
| import com.itasocialacademy.oitassist.core.exceptions.BusinessException; | ||
|
|
||
| public class StaleTaskVersionException extends BusinessException { | ||
| public StaleTaskVersionException(Long taskId) { | ||
| super("Task with id %d has been modified by another user. ".formatted(taskId), | ||
| ErrorCode.ENTITY_VERSION_CONFLICT); | ||
| } | ||
| } |
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
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
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
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
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
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
11 changes: 11 additions & 0 deletions
11
...itasocialacademy/oitassist/taskassignment/exceptions/StaleAssignmentVersionException.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package com.itasocialacademy.oitassist.taskassignment.exceptions; | ||
|
|
||
| import com.itasocialacademy.oitassist.core.enums.ErrorCode; | ||
| import com.itasocialacademy.oitassist.core.exceptions.BusinessException; | ||
|
|
||
| public class StaleAssignmentVersionException extends BusinessException { | ||
| public StaleAssignmentVersionException(Long assignmentId) { | ||
| super("Assignment with id %d has been modified by another user.".formatted(assignmentId), | ||
| ErrorCode.ENTITY_VERSION_CONFLICT); | ||
| } | ||
| } |
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
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
22 changes: 22 additions & 0 deletions
22
...changelog/logs/2026-08-26-ch-add-version-to-task-bodies-and-task-assignments-Selianyk.xml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
| https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"> | ||
|
|
||
| <changeSet id="add-version-to-task-bodies" author="Ihor Selianyk"> | ||
| <addColumn tableName="task_bodies"> | ||
| <column name="version" type="BIGINT" defaultValueNumeric="0"> | ||
| <constraints nullable="false"/> | ||
| </column> | ||
| </addColumn> | ||
| </changeSet> | ||
|
|
||
| <changeSet id="add-version-to-task-assignments" author="Ihor Selianyk"> | ||
| <addColumn tableName="task_assignments"> | ||
| <column name="version" type="BIGINT" defaultValueNumeric="0"> | ||
| <constraints nullable="false"/> | ||
| </column> | ||
| </addColumn> | ||
| </changeSet> | ||
| </databaseChangeLog> |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.