Skip to content

Conversation

hentrymartin
Copy link
Collaborator

No description provided.

transaction: t,
});

const invitesToBeUpdated = await models.ProjectMemberInvite.findAll({
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding error handling for the findAll operation to ensure that any issues during database retrieval are properly managed.

const invitesToBeUpdated = await models.ProjectMemberInvite.findAll({
where: {
applicationId: {
[Op.in]: copilotApplications.map(item => item.id),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that copilotApplications is defined and contains valid data before using it in the query. This will prevent potential runtime errors if copilotApplications is undefined or empty.

transaction: t,
});

invitesToBeUpdated.forEach((inviteToBeUpdated) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding error handling for the forEach loop to ensure that any issues with sending resources to the Kafka bus do not cause the entire transaction to fail.


invitesToBeUpdated.forEach((inviteToBeUpdated) => {
req.log.info(inviteToBeUpdated.toJSON(), 'invite to be updated')
util.sendResourceToKafkaBus(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that util.sendResourceToKafkaBus handles potential errors internally or consider wrapping it in a try-catch block to handle any exceptions that might occur during the operation.

@hentrymartin hentrymartin merged commit 595e046 into develop Jun 5, 2025
1 check passed
@hentrymartin hentrymartin deleted the pm-1169_2 branch June 5, 2025 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant