Skip to content

Conversation

@yoution
Copy link
Contributor

@yoution yoution commented Dec 21, 2021

@maxceem please review;
for testing locally, can you hardcode the id?
hardcode the file src/services/NotificationsSchedulerService.js
line 36, hardcode the projectId

  project = await helper.getProjectById(helper.getAuditM2Muser(), 17232)

line 115 and line 116, hardcode the uuid

  const hostUserDetails = await helper.getUserDetailsByUserUUID('98ec2c16-442e-4b61-8ad1-66123ee37d3c')
  const userDetails = await helper.getUserDetailsByUserUUID('98ec2c16-442e-4b61-8ad1-66123ee37d3c' )

*/
function buildProjectTeamRecipients (project) {
const recipients = _.unionBy(_.map(project.members, m => _.pick(m, 'userId')), 'userId')
const recipients = _.unionBy(_.map(project.members, m => _.pick(m, 'email')), 'email')
Copy link
Contributor

Choose a reason for hiding this comment

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

@yoution Emails could be sent by userId. I'm not sure that project members would always have email addresses. Can we keep userId here, or this breaks something?

@maxceem
Copy link
Contributor

maxceem commented Dec 23, 2021

@yoution I hardcode the lines as you suggested, and run TaaS API from scratch including npm run local:init and run the npm run demo-email-notifications though I didn't get any emails in out folder and I can see some errors in log:

[2021-12-23T08:25:00.129Z] InterviewService partiallyUpdateInterviewById ERROR : Cannot read property 'nylasCalendars' of null
[2021-12-23T08:25:00.129Z] NotificationSchedulerService ERROR : sendInterviewExpiredNotifications Service function error: TypeError: Cannot read property 'nylasCalendars' of null
[2021-12-23T08:25:01.865Z] NotificationSchedulerService ERROR : sendInterviewComingUpNotifications Service function error: Error: {"id":"-b3b31b6:17dd750084b:-22d0","result":{"success":true,"status":500,"metadata":null,"content":"Unable to unmarshall the string [{\"streetAddr2\":\"address_2\",\"zip\":\"47579\",\"createdAt\":\"2021-12-22T03:34:58.163Z\",\"streetAddr1\":\"123 Main Street\",\"updatedBy\":\"mess\",\"city\":\"Santa Clause\",\"createdBy\":\"mess\",\"stateCode\":\"IN\",\"type\":\"HOME\",\"updatedAt\":\"2021-12-22T03:34:58.163Z\"}]into interface java.util.List"},"version":"v3"}
[2021-12-23T08:25:02.264Z] NotificationSchedulerService ERROR : sendInterviewCompletedNotifications Service function error: Error: {"id":"-b3b31b6:17dd750084b:-22cf","result":{"success":true,"status":500,"metadata":null,"content":"Unable to unmarshall the string [{\"streetAddr2\":\"address_2\",\"zip\":\"47579\",\"createdAt\":\"2021-12-22T03:34:58.163Z\",\"streetAddr1\":\"123 Main Street\",\"updatedBy\":\"mess\",\"city\":\"Santa Clause\",\"createdBy\":\"mess\",\"stateCode\":\"IN\",\"type\":\"HOME\",\"updatedAt\":\"2021-12-22T03:34:58.163Z\"}]into interface java.util.List"},"version":"v3"}

So it doesn't work for me as per local testing.

@maxceem
Copy link
Contributor

maxceem commented Dec 23, 2021

@yoution I've tested by hardcoding other users and it seems to work good for me localy

const hostUserDetails = await helper.getUserDetailsByUserUUID('7669c1d3-f300-466b-8e77-792c3c65ff7d')
const userDetails = await helper.getUserDetailsByUserUUID('5659f247-823e-4979-aebd-d1083209f5bd')

I'm merging this PR for QA. But could you please let me know if we can revert the change for Project members above? #650 (review)

Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

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

@yoution merging for QA.

@maxceem maxceem merged commit 04181db into topcoder-platform:dev Dec 23, 2021
@yoution
Copy link
Contributor Author

yoution commented Dec 23, 2021

@maxceem I will revert to userid, wait a moment

@maxceem
Copy link
Contributor

maxceem commented Dec 23, 2021

@yoution already merged :-), could you please create a new PR with reverted change.

@yoution
Copy link
Contributor Author

yoution commented Dec 23, 2021

@maxceem #651

@maxceem
Copy link
Contributor

maxceem commented Dec 23, 2021

@yoution thanks, merged.

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.

2 participants