Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

[$175] Integrate Connect Calendar feature #519

Open
maxceem opened this issue Oct 21, 2021 · 41 comments
Open

[$175] Integrate Connect Calendar feature #519

maxceem opened this issue Oct 21, 2021 · 41 comments

Comments

@maxceem
Copy link
Contributor

maxceem commented Oct 21, 2021

Recently we've implemented Connect Calendar feature in API in this challenge https://www.topcoder.com/challenges/af9a1041-7a78-484d-87d3-5aec9e87b578?tab=details

Now we would like to integrate it with UI.

To work on this task you would have to run locally TaaS API and TaaS App as per this guide.

General Logic

  • User clicks a link to connect calendar
  • Redirected to Google/Microsoft/Nylas
  • From there it redirected to TaaS API to save connected calendar details
  • And from TaaS API it is redirected back to TaaS APP
  • When redirected to TaaS App from link we have to know what interview popup to open and if calendar connection was successful or failed.

Task

image

  • Build link as described in this challenge https://www.topcoder.com/challenges/af9a1041-7a78-484d-87d3-5aec9e87b578?tab=details
    • As redirectTo set URL to the current page + add ?interviewWithCandidate={jobCandidateId}, example https://platform.topcoder-dev.com/taas/myteams/18907/positions/a14d4946-418c-4329-998e-918603348fe2/candidates/interviews?interviewWithCandidate=8b0346e8-76bd-4c8c-b378-d27d3ce24262
  • When calendar is connected and redirected back to TaaS APP there could be 2 situations:
    • calendar connected successfully:
      • in this case it would redirect to the page with the next params ?interviewWithCandidate={jobCandidateId}&calendarConnected=true
      • show interview scheduling modal as if we click button "schedule interview" https://monosnap.com/file/jzsr7LVUjWxz5lv2Yb7pKppXKG3wiR
      • show green toast which say that "Calendar was successfully connected."
      • remove part ?interviewWithCandidate={jobCandidateId}&calendarConnected=true from URL
    • calendar connection failed:
      • in this case it would redirect to the page with the next params ?interviewWithCandidate={jobCandidateId}&calendarConnected=false&error={errorReason}
      • show red toast which say that "Failed to connect calendar: {errorReason}"
      • remove part ?interviewWithCandidate={jobCandidateId}&calendarConnected=false&error={errorReason} from URL

Verification

Provide demo video(s) showing both cases: calendar connected successfully or failed.

@maxceem maxceem changed the title Integrate Connect Calendar feature [$100] Integrate Connect Calendar feature Oct 21, 2021
@deblasis
Copy link

Hi @maxceem! I am happy to work on this if you agree

@maxceem
Copy link
Contributor Author

maxceem commented Oct 21, 2021

Sure, assigned you @deblasis.

@deblasis
Copy link

Hi @maxceem since you didn't specify otherwise, I was expecting to find the new design changes with the Nylas schedule interview "wizard" (as per your screenshot) merged to dev already.

Just to make sure that I fully understand the scope of the changes can you please point out the source branches for taas-apis and taas-app ?

Cheers

@maxceem
Copy link
Contributor Author

maxceem commented Oct 22, 2021

hi @deblasis

In both repositories we have to use branch feature/interview-update as mentioned in this guide https://github.com/topcoder-platform/taas-app/wiki/Run-TaaS-App-with-TaaS-API-locally-to-test-Interview-Scheduling-using-Nylas

@maxceem maxceem added this to the Interview Update (Nylas) milestone Oct 22, 2021
@deblasis deblasis removed their assignment Oct 22, 2021
@yoution
Copy link
Contributor

yoution commented Oct 23, 2021

@maxceem please assign to me

@yoution yoution removed their assignment Oct 24, 2021
@yoution
Copy link
Contributor

yoution commented Oct 24, 2021

@maxceem please ask others to finish this one, I don't have time to finish it

@maxceem
Copy link
Contributor Author

maxceem commented Oct 24, 2021

@yoution if we extend time till tomorrow end of the day, would it help you?

@yoution
Copy link
Contributor

yoution commented Oct 24, 2021

@maxceem , sorry, I am not familiar with Google/Microsoft, to configure these two apps will waste me a lot of time, I hope others can help you

@maxceem maxceem changed the title [$100] Integrate Connect Calendar feature [$175] Integrate Connect Calendar feature Oct 24, 2021
@maxceem
Copy link
Contributor Author

maxceem commented Oct 24, 2021

got it @yoution, no problem

The payment for this issue has been raised to $175.

@deblasis, @mahidulalvi-bonic if you would like to work on this issue and can complete it by Tuesday 26 October 9am GMT+3, just let me know in comment and you may start working on it.

@ghost
Copy link

ghost commented Oct 24, 2021

@maxceem , I can work on it.

@maxceem maxceem assigned ghost Oct 24, 2021
@maxceem
Copy link
Contributor Author

maxceem commented Oct 24, 2021

Sure, assigned to you @mahidulalvi-bonic

@ghost
Copy link

ghost commented Oct 24, 2021

Thanks.

@ghost
Copy link

ghost commented Oct 25, 2021

Hi @maxceem , the requirement 1 says, "As redirectTo set URL to the current page + add ?interviewWithCandidate={jobCandidateId}, example https://platform.topcoder-dev.com/taas/myteams/18907/positions/a14d4946-418c-4329-998e-918603348fe2/candidates/interviews?interviewWithCandidate=8b0346e8-76bd-4c8c-b378-d27d3ce24262"

Here, the example url has '...candidates/interviews' but when I run the app the url is '.../candidates/to-review'. Should I use the one in the app?

@maxceem
Copy link
Contributor Author

maxceem commented Oct 25, 2021

@ghost
Copy link

ghost commented Oct 25, 2021

@maxceem , should the JWT token in the 'state' param have any expiry? If so, how long should it be?

And in case, jwt is not verified due to expiry/invalid secret, how should it work? Should it show an error from API in blank page like: {"message":"Could not verify JWT token."}, or should it try to look into jwt without verifying, and use the redirectTo to redirect back? This may require additional sanitising.

@ghost
Copy link

ghost commented Oct 26, 2021

Hi @maxceem , I sent another demo video in your email.

@maxceem
Copy link
Contributor Author

maxceem commented Oct 26, 2021

Hi @mahidulalvi-bonic no need to make it expired or verification. Basically for now we are only using it to compress the data we pass, because state has very limit length, and using JWT we can compress a big object.

@maxceem
Copy link
Contributor Author

maxceem commented Oct 26, 2021

Thank you @mahidulalvi-bonic all works good.
Payment is processed https://www.topcoder.com/challenges/502cfdda-859b-42de-b772-d6022be7cff3

@maxceem maxceem added the PAID label Oct 26, 2021
@ghost
Copy link

ghost commented Oct 26, 2021

No problem, thanks.

@sdgun
Copy link

sdgun commented Nov 1, 2021

@mahidulalvi-bonic @maxceem Seeing the below error when trying to connect the calender

Error
Sorry, an error occurred :(

Status 500:

An internal error occurred. If this issue persists, please contact support and copy/paste this request_uid: "A29E1630:6E28_0A4D0942:01BB_617F6B7B_35ABE:2568".
2021-11-01_9-52-35.mp4

@sandhiyakavi
Copy link
Collaborator

sandhiyakavi commented Nov 1, 2021

@maxceem While trying the same above scenario, I am getting a different error "{"message":"Could not verify JWT token."}"
at the api level.
image

Note: But the Google account connected successfully when I tried to schedule interview again by Connecting to the Google account

@maxceem
Copy link
Contributor Author

maxceem commented Nov 1, 2021

Thank you @sdgun @sandhiyakavi

We would try to debug it. If you happen to have such issues again, could you please, copy/paste the URL from the browser which you had when error happens. It might help debugging it.

@maxceem
Copy link
Contributor Author

maxceem commented Nov 1, 2021

@sdgun regarding your issue during connecting calendar. I see that you are using email [email protected]. I wonder if you ever used the same email with + sign like [email protected]?

I've noticed that if we use with Nylas email with + then if we try to connect calendar with the same email with + or without + it got broken.

So we always have to use real different emails we cannot use the same email with + because it points to the same Google account and lead to such issues.

cc @sandhiyakavi just in case

@maxceem
Copy link
Contributor Author

maxceem commented Nov 1, 2021

@sandhiyakavi could you, please, try testing it one more time. Your issue has to be resolved now.

@sdgun
Copy link

sdgun commented Nov 1, 2021

@maxceem So far I only had this issue with taasintake3 which I have used with a + to create another user. I will check with some more users tommorrow.

@sandhiyakavi
Copy link
Collaborator

@maxceem Verified. I am not getting TokenExpiredError now.

@sdgun
Copy link

sdgun commented Nov 2, 2021

@maxceem Tried with a fresh user today and I am seeing these errors, also we don't get the interview booked email anymore

2021-11-02_10-08-19.mp4

@maxceem
Copy link
Contributor Author

maxceem commented Nov 2, 2021

@sdgun does this error happen if you select calendar permissions from the first time without going back?

@sdgun
Copy link

sdgun commented Nov 2, 2021

@maxceem Yes

@sdgun
Copy link

sdgun commented Nov 3, 2021

@maxceem Don't see any of the errors seen in the above comment video anymore, but the first time a new user connecting calender, always got the below error and it didn't connect the calender. But it worked second time.

Error: Could not find any writable calender

Failed.calender.connecting.mp4

@ghost
Copy link

ghost commented Nov 3, 2021

Hi @maxceem, just saw this, I encountered this issue when creating new users in Exchange and it used to go away after some time but usually happened just after creating Exchange account.

@maxceem
Copy link
Contributor Author

maxceem commented Nov 3, 2021

@mahidulalvi-bonic I did some debugging and it looks likes a Nylas issue. At the moment when it redirects us to API the calendar is not yet returned by Nylas API. But if we try to get it after some time it’s there. I’ve reported it to Nylas support and waiting for response.

@sdgun
Copy link

sdgun commented Nov 5, 2021

Thank you @sdgun @sandhiyakavi

We would try to debug it. If you happen to have such issues again, could you please, copy/paste the URL from the browser which you had when error happens. It might help debugging it.

@maxceem I got this sporadically again, here is the url:

https://api.nylas.com/oauth/callback?state=7zfb3l5qmnreyoft6kb55j76i&code=4/0AX4XfWiRH2Mn7Iqvhr69FYBwAxubQZTa-Ry4LL1xmAuvUGcFJmFsS4bPaJMQye-0oD-6zA&scope=email%20profile%20https://www.googleapis.com/auth/calendar%20openid%20https://www.googleapis.com/auth/userinfo.profile%20https://www.googleapis.com/auth/userinfo.email&authuser=4&prompt=consent

2021-11-05_18-00-51.mp4

@maxceem
Copy link
Contributor Author

maxceem commented Nov 5, 2021

Thank you for the demo video @sdgun. By any chance did you ever use the same email with + sign? like [email protected].

@sdgun
Copy link

sdgun commented Nov 5, 2021

@maxceem As far as I remember I haven't used it

@sdgun
Copy link

sdgun commented Nov 25, 2021

@maxceem We still have #519 (comment), I guess this has not been addressed yet

@maxceem
Copy link
Contributor Author

maxceem commented Nov 25, 2021

@maxceem We still have #519 (comment), I guess this has not been addressed yet

Yeah, it still has to be fixed. I created a separate issue to track it #580.

Is this the only one thing which left not working here?

@sdgun
Copy link

sdgun commented Nov 25, 2021

@maxceem We are waiting for connect Microsoft calender testing, if it is handled in a separate ticket that's all the issues for this

@maxceem
Copy link
Contributor Author

maxceem commented Nov 25, 2021

@sdgun got it. I've created a separate issue for Microsoft calendar for easier tracking, so it's clear what has to be done #581

@sdgun
Copy link

sdgun commented Apr 5, 2022

Removing the milestone since this feature was disabled in the current production release #598

@sdgun sdgun removed this from the Interview Update (Nylas) milestone Apr 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants