fix: technique proposal rejection comment set before proposal status change - #1847
Open
ellen-wright wants to merge 9 commits into
Open
ellen-wright wants to merge 9 commits into
ellen-wright wants to merge 9 commits into
Conversation
ellen-wright
requested review from
SourangshuSTFC
and removed request for
a team
September 30, 2026 13:37
ellen-wright
requested review from
deepaksftc and
mutambaraf
and removed request for
SourangshuSTFC
September 30, 2026 14:01
mutambaraf
reviewed
Sep 30, 2026
mutambaraf
reviewed
Sep 30, 2026
mutambaraf
left a comment
Contributor
There was a problem hiding this comment.
On this line
args: CreateProposalInternalCommentArgs
): Promise {
try {
const [proposalRejectionComment]: ProposalInternalCommentRecord[] =
await database.transaction(async (trx) => {
await trx(
'proposal_rejection_comments'
)
.where('proposal_pk', args.proposalPk)
.del();
return trx('proposal_rejection_comments')
.insert({
proposal_pk: args.proposalPk,
comment: args.comment,
})
.returning('*');
});
if (!proposalRejectionComment) {
throw new GraphQLError(
'Proposal rejection comment could not be created'
);
}
return createProposalInternalCommentObject(proposalRejectionComment);
} catch (error) {
logger.logException(
`Could not create proposal rejection comment with args: '${JSON.stringify(args)}'`,
error
);
throw new GraphQLError('Error while creating proposal rejection comment');
}
}`
…UserOfficeProject/user-office-core into fix-rejection-comment-email-bug
jekabs-karklins
self-requested a review
October 2, 2026 12:00
Comment on lines
+89
to
93
| logger.logException( | ||
| `Could not create proposal rejection comment with args: '${JSON.stringify(args)}'`, | ||
| error | ||
| ); | ||
| throw new GraphQLError('Error while creating proposal rejection comment'); |
Contributor
There was a problem hiding this comment.
suggestion: Can we move the args into the context parameter? The reason is that we would like to use the exception title for aggregation, i.e. no dynamic values in the title.
Suggested change
| logger.logException( | |
| `Could not create proposal rejection comment with args: '${JSON.stringify(args)}'`, | |
| error | |
| ); | |
| throw new GraphQLError('Error while creating proposal rejection comment'); | |
| logger.logException( | |
| `Could not create proposal rejection comment`, | |
| error, | |
| args | |
| ); | |
| throw new GraphQLError('Error while creating proposal rejection comment'); |
jekabs-karklins
left a comment
Contributor
There was a problem hiding this comment.
Just a small comment
mutambaraf
reviewed
Oct 2, 2026
| 'Proposal rejection comment successfully created', | ||
| }) | ||
| .createProposalRejectionComment({ | ||
| proposalPk: unsuccessfullPK, |
Contributor
There was a problem hiding this comment.
We may need to use primaryKey instead of unsuccessfullPK.
This branch has not been deployed
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.
Description
As part of UserOfficeProject/issue-tracker#1533
Motivation and Context
The comment that can be set by a scientist when a technique proposal's status is set to 'Unsuccessful' was not being populated correctly in the status action emails sent upon status change.
Fixes
The order of the comment being set in the database and the status being changed in the workflow (therefore sending any status action emails) has been switched to make sure the comment is available to be sent in the 'Unsuccessful' email to users.
Tests included/Docs Updated?