feat: Rollback fix with suggestion updates#1288
Closed
anshulk-public wants to merge 13 commits intomainfrom
Closed
feat: Rollback fix with suggestion updates#1288anshulk-public wants to merge 13 commits intomainfrom
anshulk-public wants to merge 13 commits intomainfrom
Conversation
|
This PR will trigger a minor release when merged. |
sandsinh
reviewed
Feb 5, 2026
sandsinh
reviewed
Feb 5, 2026
sandsinh
reviewed
Feb 5, 2026
sandsinh
reviewed
Feb 5, 2026
sandsinh
reviewed
Feb 5, 2026
sandsinh
reviewed
Feb 5, 2026
sandsinh
reviewed
Feb 5, 2026
sandsinh
approved these changes
Feb 24, 2026
0e55901 to
5450020
Compare
Contributor
Author
|
@ekremney @solaris007 |
Member
|
@anshulk-public @sandsinh I am not sure it will have a big impact, as we are in the process of migrating to the new data service under PostgREST. |
c865909 to
a6ecac6
Compare
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 update for fix entity and suggestion statuses
Summary
Adds
updateFixAndSuggestionsStatus()toFixEntityCollectionthat atomically updates a fix entity’s status and all linked suggestions’ status in a single database operation. The method uses a PostgREST RPC so all updates succeed or fail together in one transaction. It is generic and reusable, with configurable fix and suggestion statuses (e.g. rollback: fix →ROLLED_BACK, suggestions →SKIPPED).Jira
What changed
updateFixAndSuggestionsStatus()onFixEntityCollection.rpc_update_fix_and_suggestions_status(migration in mysticat-data-service)fix-entity/index.d.ts(signature and return type){ fix, suggestions }Why this change?
ROLLED_BACK/SKIPPED) and other status flows via parameters.How it works
fixEntityIdandopportunityId(UUIDs),newSuggestionStatusandnewFixEntityStatus(non-empty strings).getSuggestionsByFixEntityId(fixEntityId). If none, throwValidationError('No suggestions found for the fix entity').postgrestService.rpc('rpc_update_fix_and_suggestions_status', { p_fix_entity_id, p_fix_entity_status, p_new_suggestion_status }). The DB function updatesfix_entitiesand all linked rows insuggestionsin one transaction.DataAccessErrorwith the RPC error message (or a generic message if none).findById(fixEntityId)andgetSuggestionsByFixEntityId(fixEntityId). If fix is missing, throwDataAccessError.{ fix, suggestions }(model instances) for use by controllers.API signature