Merge pull request #4304 from omnivore-app/fix/newsletter

add debugging logs for inbound-email-handler and keep email job data once completed or failed
This commit is contained in:
Hongbo Wu
2024-08-22 11:43:09 +08:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@ -55,7 +55,10 @@ export const inboundEmailHandler = Sentry.GCPFunction.wrapHttpFunction(
console.log('no data or name for ', part)
}
}
console.log('parsed', parsed)
const headers = parseHeaders(parsed.headers)
console.log('headers', headers)
// original sender email address
const from = parsed['from']
@ -89,7 +92,7 @@ export const inboundEmailHandler = Sentry.GCPFunction.wrapHttpFunction(
// check if it is a subscription or google confirmation email
const isGoogleConfirmation = isGoogleConfirmationEmail(from, subject)
if (isGoogleConfirmation || isSubscriptionConfirmationEmail(subject)) {
console.debug('handleConfirmation', from, subject)
console.log('handleConfirmation', from, subject)
// we need to parse the confirmation code from the email
if (isGoogleConfirmation) {
await handleGoogleConfirmationEmail(
@ -114,7 +117,7 @@ export const inboundEmailHandler = Sentry.GCPFunction.wrapHttpFunction(
return res.send('ok')
}
if (attachments.length > 0) {
console.debug('handle attachments', from, to, subject)
console.log('handle attachments', from, to, subject)
// save the attachments as articles
await handleAttachments(
redisDataSource,

View File

@ -49,8 +49,6 @@ const getPriority = (jobType: EmailJobType): number => {
const getOpts = (jobType: EmailJobType): BulkJobOptions => {
return {
removeOnComplete: true,
removeOnFail: true,
attempts: 3,
priority: getPriority(jobType),
backoff: {