Skip to content

Send Weekly Surveys #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

yoution
Copy link
Contributor

@yoution yoution commented Aug 2, 2021

@maxceem please merge

@yoution
Copy link
Contributor Author

yoution commented Aug 3, 2021

@maxceem please 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

I'm trying to test sending survey locally, though I'm getting errors like these
image
do you have some idea what could be the reason? I'm using the config from the validation guide.

Also, regarding this update in code I'm not sure how this would help, as for me to fix this issue "As per logs in Run 02, encountered "ERROR : Error : socket hang up" during the sending of first survey. There's no exception handler and theres no way to recover (other than to restart or reset cron)." we have to wrap each of await partiallyUpdateWorkPeriod inside additional try {} catch () {} so we catch any error which happens during updating work period too.

image

@yoution
Copy link
Contributor Author

yoution commented Aug 3, 2021

@maxceem can we change the date format to d/m/yyyy to dd/mm/yyyy

@maxceem
Copy link
Contributor

maxceem commented Aug 3, 2021

@yoution actually this format we have been already using for such surveys, so I don’t think we can change it. Any issues with it?

@yoution
Copy link
Contributor Author

yoution commented Aug 3, 2021

you can change to dd/mm/yyyy firstly, I will debug the code, wait a moment

@maxceem
Copy link
Contributor

maxceem commented Aug 3, 2021

Thanks, I’ll check tomorrow morning using this format, though ideally we need to use existent format.

@yoution
Copy link
Contributor Author

yoution commented Aug 3, 2021

image
I can not reproduce the error locally,
https://github.com/yoution/taas-apis/blob/feature/weekly-surveys/src/common/surveyMonkey.js#L48, is this line?

@yoution
Copy link
Contributor Author

yoution commented Aug 3, 2021

@maxceem please ignore the format error, maybe the surveyId is not correct?
image

@yoution
Copy link
Contributor Author

yoution commented Aug 3, 2021

@maxceem for socket hang up error, maybe
image
the tc-bus-api should update

@topcoder-platform topcoder-platform deleted a comment from yoution Aug 4, 2021
@maxceem
Copy link
Contributor

maxceem commented Aug 4, 2021

@yoution your config you shared above helped me, thanks! (btw, I've removed it from the comment)

The only one thing left: the app should not crash is some error happens.
For now, if some error happens during partiallyUpdateWorkPeriod() the whole app crashes.
To reproduce the issue I throw error:

async function partiallyUpdateWorkPeriod (currentUser, id, data) {
  throw new Error('some error during WP update')
  return updateWorkPeriod(currentUser, id, data)
}

image

So what should be done to prevent this I think:

  1. Don't make this change to the code:

    I'm not sure why this change was done, if there is any reason for this, please let me know.

    image

  2. Each partiallyUpdateWorkPeriod() during sending serveys should be wrapped into try {} catch so error happened during partiallyUpdateWorkPeriod should be catched and just logged by logger. But don't break the whole app.

@yoution
Copy link
Contributor Author

yoution commented Aug 4, 2021

@maxceem for 1. why did I change the code, because when error happened in partiallyUpdateWorkPeriod ,
but actually, the survery has been sent successfully, when it will go into the error, it will set the sendSurvey: false and sentSurveyError: e
2. I will fix soon

@yoution yoution requested a review from maxceem August 4, 2021 09:30
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.

Thanks for the quick updates @yoution all works good now.

@maxceem maxceem merged commit 406c5a1 into topcoder-platform:feature/weekly-surveys Aug 4, 2021
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