feat: Rollback fix with suggestion updates#1288
Open
anshulk-public wants to merge 10 commits intomainfrom
Open
feat: Rollback fix with suggestion updates#1288anshulk-public wants to merge 10 commits intomainfrom
anshulk-public wants to merge 10 commits intomainfrom
Conversation
|
This PR will trigger a minor release when merged. |
sandsinh
reviewed
Feb 5, 2026
packages/spacecat-shared-data-access/src/models/fix-entity/fix-entity.collection.js
Outdated
Show resolved
Hide resolved
sandsinh
reviewed
Feb 5, 2026
packages/spacecat-shared-data-access/src/models/fix-entity/fix-entity.collection.js
Outdated
Show resolved
Hide resolved
sandsinh
reviewed
Feb 5, 2026
packages/spacecat-shared-data-access/src/models/fix-entity/fix-entity.collection.js
Outdated
Show resolved
Hide resolved
sandsinh
reviewed
Feb 5, 2026
packages/spacecat-shared-data-access/src/models/fix-entity/fix-entity.collection.js
Show resolved
Hide resolved
sandsinh
reviewed
Feb 5, 2026
packages/spacecat-shared-data-access/src/models/fix-entity/fix-entity.collection.js
Outdated
Show resolved
Hide resolved
sandsinh
reviewed
Feb 5, 2026
packages/spacecat-shared-data-access/src/models/fix-entity/fix-entity.collection.js
Outdated
Show resolved
Hide resolved
sandsinh
reviewed
Feb 5, 2026
packages/spacecat-shared-data-access/src/models/fix-entity/fix-entity.collection.js
Outdated
Show resolved
Hide resolved
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.
Add atomic rollback operation for fixes with suggestion updates
Summary
Adds a new
rollbackFixWithSuggestionUpdates()method toFixEntityCollectionthat atomically rolls back a fix entity and updates all associated suggestions in a single DynamoDB transaction. The method is designed to be generic and reusable, fetching suggestions internally and allowing configurable status updates.jira
What Changed
rollbackFixWithSuggestionUpdates()method toFixEntityCollection(lines 283-399)fix-entity/index.d.tsWhy This Change?
This method enables safe, atomic rollback of fixes by:
FixEntitystatus toROLLED_BACKSuggestionentities to a configurable status (defaults toSKIPPED)The atomic transaction ensures either all updates succeed or none are applied, preventing partial rollback states that could leave the system in an inconsistent state.
How It Works
The method uses ElectroDB's
transaction.write()to perform the following atomically:getSuggestionsByFixEntityId())ROLLED_BACK(no status precondition - generic update)newSuggestionStatus(no status precondition - generic update)Documentation for transact.write()
API Signature
async rollbackFixWithSuggestionUpdates(
fixEntityId: string,
opportunityId: string,
newSuggestionStatus?: string,
options?: {token?: string}
): Promise<{
canceled: boolean,
fix: FixEntity,
suggestions: Array
}>
Validation & Error Handling
ValidationErrorfor input validation failuresDataAccessErrorfor transaction failuresVersion Impact
This is a minor version feature addition (backward compatible).
Please ensure your pull request adheres to the following guidelines:
Related Issues
Thanks for contributing!