topcoder-platform / taas-app

TaaS App Front End
3 stars 24 forks source link

Added interview cancel & reschedule page. #574

Closed ghost closed 2 years ago

ghost commented 2 years ago

Changes for issue https://github.com/topcoder-platform/taas-apis/issues/587.

ghost commented 2 years ago

@maxceem, sorry, some last minute changes had imports missing. Fixed now.

ghost commented 2 years ago

@maxceem, I checked the links and it works and event hash also getting saved in DB after the fixes. Can you please test now?

My test was broken midway as rescheduling the interview triggered a cancel event, but may be we need to add code for handling update events(currently we have create and update)? But it would be great to know how it works for you.

ghost commented 2 years ago

Actually, my test worked. The reschedule was done correctly. That error was because, before rescheduling, the event is cancelled(? - reading the logs). But after some moments, I saw the rescheduled notification in terminal.

maxceem commented 2 years ago

My test was broken midway as rescheduling the interview triggered a cancel event, but may be we need to add code for handling update events(currently we have create and update)? That error was because, before rescheduling, the event is cancelled(? - reading the logs)

So did rescheduling worked for you or no?

Rescheduling in Nylas works like this:

  1. first they create a new event (webhook triggered)
  2. after that they cancel previous event (that's why we check in update webhook interview.nylasEventId === event.id to make sure that cancelled event is the current event). As on step we already updated nylasEventId so this interview should not get cancelled.

Does this workflow works good for you?

ghost commented 2 years ago

My test was broken midway... Does this workflow works good for you?

It worked, although I misread the logs when I saw Get event details error, 404 I think this was because the event was already deleted.

So workflow works good for me I think.. Columns in the DB record were updated correctly.

maxceem commented 2 years ago

@mahidulalvi-bonic I'm currently testing it out but the weird thing is that new webhook (like https://2e58-77-120-181-211.ngrok.io/api/v5/updateInterview/b0f22cc1-fa35-4fb3-8d1d-8f9462d76201/nylas-webhooks) is never called for me.

Could you please, try scheduling and accepting a new meeting one more time and check if a new webhook works for you now. (it worked for me previously, but now seems something broken and I cannot understand if I'm doing something wrong, or something has broken on the Nylas side)

ghost commented 2 years ago

@maxceem, I tried again and it works for me. Did you create a webhook in the Nylas dashboard for the global endpoint? And also, does this url's domain match with what is set in file NylasService (https://github.com/topcoder-platform/taas-apis/blob/a336c1d2e3581fb5430378252adc02b007416036/src/services/NylasService.js#L136)?

And in the Nylas webhooks dashboard, the hook needs to be in running state, sometimes it goes into pause because it can't connect to API when API is down..

maxceem commented 2 years ago

Thanks a lot checking it. I did check all these URL, but somehow it doesn't work for me. As it work for it must be something with my config, so I'm re-checking my config.

ghost commented 2 years ago

@maxceem, I may have found the issue you had with webhook endpoint not being called. The env variable TAAS_APP_BASE_URL was not added to Git properly so it might have thrown silent errors in your case. For me, it was still in my file so I had the changes.

I pushed a fix for it in the latest commit.