Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions athena/queues/channel-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ export default async (job: Job<ChannelNotificationJobData>) => {

// for each person who should receie an updated notification, mark their notification as unseen and unread
return Promise.all([notificationPromises]).catch(err => {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
});
};
6 changes: 3 additions & 3 deletions athena/queues/community-invite.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default async (job: Job<CommunityInviteNotificationJobData>) => {
sender,
customMessage
).catch(err => {
debug(err);
console.error(err);
Raven.captureException(err);
});
} else {
Expand Down Expand Up @@ -149,8 +149,8 @@ export default async (job: Job<CommunityInviteNotificationJobData>) => {
sendInvite,
usersNotification,
]).catch(err => {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
});
}
Expand Down
4 changes: 2 additions & 2 deletions athena/queues/community-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export default async (job: Job<CommunityNotificationJobData>) => {
try {
return Promise.all([notificationPromises]);
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions athena/queues/create-thread-notification-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ const createThreadNotificationEmail = async (

// send all the emails
return Promise.all([emailPromises]).catch(err => {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
});
};
Expand Down
4 changes: 2 additions & 2 deletions athena/queues/direct-message-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ export default async (job: Job<DirectMessageNotificationJobData>) => {
});

return Promise.all(formatAndBufferPromises).catch(err => {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
});
};
4 changes: 2 additions & 2 deletions athena/queues/mention-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ export default async ({ data }: Job<MentionNotificationJobData>) => {
}),
storeUsersNotifications(storedNotification.id, recipient.id),
]).catch(err => {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
});
};
4 changes: 2 additions & 2 deletions athena/queues/new-message-in-thread/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ export default async (job: Job<MessageNotificationJobData>) => {
);

return Promise.all(formatAndBufferPromises).catch(err => {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
});
};
4 changes: 2 additions & 2 deletions athena/queues/private-channel-request-approved.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export default async (job: Job<PrivateChannelRequestApprovedJobData>) => {
...usersEmailPromises, // handle emails separately
...usersNotificationPromises, // update or store usersNotifications in-app
]).catch(err => {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
});
};
4 changes: 2 additions & 2 deletions athena/queues/private-channel-request-sent.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export default async (job: Job<PrivateChannelRequestJobData>) => {
usersEmailPromises, // handle emails separately
usersNotificationPromises, // update or store usersNotifications in-app
]).catch(err => {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
});
};
4 changes: 2 additions & 2 deletions athena/queues/private-community-request-approved.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ export default async (job: Job<PrivateCommunityRequestApprovedJobData>) => {
...usersEmailPromises, // handle emails separately
...usersNotificationPromises, // update or store usersNotifications in-app
]).catch(err => {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
});
};
4 changes: 2 additions & 2 deletions athena/queues/private-community-request-sent.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export default async (job: Job<PrivateCommunityRequestJobData>) => {
usersEmailPromises, // handle emails separately
usersNotificationPromises, // update or store usersNotifications in-app
]).catch(err => {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
});
};
6 changes: 3 additions & 3 deletions athena/queues/reaction-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default async (job: Job<ReactionNotificationJobData>) => {
return Promise.all([
markUsersNotificationsAsNew(updatedNotification.id, message.senderId),
]).catch(err => {
debug(err);
console.error(err);
Raven.captureException(err);
});
} else {
Expand Down Expand Up @@ -119,8 +119,8 @@ export default async (job: Job<ReactionNotificationJobData>) => {
return Promise.all([
storeUsersNotifications(updatedNotification.id, message.senderId),
]).catch(err => {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
});
}
Expand Down
8 changes: 5 additions & 3 deletions athena/queues/send-push-notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import Raven from '../../shared/raven';
import type { Job, PushNotificationsJobData } from 'shared/bull/types';

export default async (job: Job<PushNotificationsJobData>) => {
const { data: { notification } } = job;
const {
data: { notification },
} = job;

try {
return sendPushNotifications(notification);
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions athena/queues/send-slack-invitations.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ export default async (job: Job<SendSlackInvitationsJobData>) => {
try {
await processJob(job);
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions athena/queues/thread-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ export default async (job: Job<ThreadNotificationJobData>) => {
), // handle emails separately
slackNotificationPromise,
]).catch(err => {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
console.error(err);
});
Expand Down
6 changes: 3 additions & 3 deletions athena/queues/thread-reaction-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default async (job: Job<ThreadReactionNotificationJobData>) => {
return Promise.all([
markUsersNotificationsAsNew(updatedNotification.id, thread.creatorId),
]).catch(err => {
debug(err);
console.error(err);
Raven.captureException(err);
});
} else {
Expand Down Expand Up @@ -108,8 +108,8 @@ export default async (job: Job<ThreadReactionNotificationJobData>) => {
return Promise.all([
storeUsersNotifications(updatedNotification.id, thread.creatorId),
]).catch(err => {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
});
}
Expand Down
6 changes: 2 additions & 4 deletions athena/queues/track-user-thread-last-seen.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,8 @@ export default async (job: Job<UserThreadLastSeenJobData>) => {
debug(`lastSeen successfully stored`);
})
.catch(err => {
debug(
'❌ Error in job for\nuserId: ${userId}\nthreadId: ${threadId}\ntimestamp: ${timestamp}'
);
debug(err);
console.error('❌ Error in job');
console.error(err);
Raven.captureException(err);
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const sendExpoPushNotifications = (
})
.catch(err => {
// This means Expo is down or something
console.error(err);
Raven.captureException(err);
})
);
Expand Down