topcoder-platform / taas-app

TaaS App Front End
3 stars 24 forks source link

Getting Error if user tries to connect another Google account. #565

Open sandhiyakavi opened 2 years ago

sandhiyakavi commented 2 years ago

Description:

Getting Error ""Failed to connect calendar: coud not find any writable calendar"" if user tries to connect another Google account . Steps to Reproduce:

  1. Connect a Google account to the user. (Google account: testsaar28@gmail.com)
  2. Without removing the account, try to connect another Google account. (kavinaya14a@gmail.com)

api: GET/taas-teams/user-meeting-settings/71c5e6a8-51d9-4fb5-91ce-d974642531af

calendar_error
maxceem commented 2 years ago

Sum up:

maxceem commented 2 years ago

I've implemented a retry policy during 30 seconds as recommended by Nylas support https://github.com/topcoder-platform/taas-apis/commit/b780c89be9d7355f4afe87d25f2e1a126c1533ba, but it didn't help. Even 30 seconds is not enough, while Nylas support recommended to wait up to 20 seconds, see log:

[2021-11-25T15:34:15.429Z] NylasService getAccessToken DEBUG : input arguments: { code: 'XXX' }
[2021-11-25T15:34:15.898Z] NylasService getAccessToken DEBUG : output arguments: { accountId: '22rsvnmpboum0sg7ghleopu0c', accessToken: 'XXX', provider: 'eas', email: 'taasintake500@outlook.com' }
[2021-11-25T15:34:15.898Z] NylasService getExistingCalendars DEBUG : input arguments: { accessToken: 'eE2PqgRjrtTkPVAkGcTCpQDQB0cf8x' }
[2021-11-25T15:34:16.112Z] NylasService getExistingCalendars DEBUG : output arguments: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ]
[2021-11-25T15:34:16.112Z] NylasService getPrimaryCalendar DEBUG : input arguments: { calendars: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ] }
[2021-11-25T15:34:16.112Z] NylasService getPrimaryCalendar DEBUG : output arguments: undefined
[2021-11-25T15:34:16.113Z] InterviewService getConnectedCalendarWithRetry DEBUG : did not get connected calendar
[2021-11-25T15:34:16.113Z] InterviewService getConnectedCalendarWithRetry DEBUG : trying to get connected calendar again...
[2021-11-25T15:34:17.113Z] NylasService getExistingCalendars DEBUG : input arguments: { accessToken: 'eE2PqgRjrtTkPVAkGcTCpQDQB0cf8x' }
[2021-11-25T15:34:17.336Z] NylasService getExistingCalendars DEBUG : output arguments: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ]
[2021-11-25T15:34:17.336Z] NylasService getPrimaryCalendar DEBUG : input arguments: { calendars: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ] }
[2021-11-25T15:34:17.336Z] NylasService getPrimaryCalendar DEBUG : output arguments: undefined
[2021-11-25T15:34:17.336Z] InterviewService getConnectedCalendarWithRetry DEBUG : did not get connected calendar
[2021-11-25T15:34:17.336Z] InterviewService getConnectedCalendarWithRetry DEBUG : trying to get connected calendar again...
[2021-11-25T15:34:18.537Z] NylasService getExistingCalendars DEBUG : input arguments: { accessToken: 'eE2PqgRjrtTkPVAkGcTCpQDQB0cf8x' }
[2021-11-25T15:34:18.751Z] NylasService getExistingCalendars DEBUG : output arguments: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ]
[2021-11-25T15:34:18.751Z] NylasService getPrimaryCalendar DEBUG : input arguments: { calendars: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ] }
[2021-11-25T15:34:18.751Z] NylasService getPrimaryCalendar DEBUG : output arguments: undefined
[2021-11-25T15:34:18.751Z] InterviewService getConnectedCalendarWithRetry DEBUG : did not get connected calendar
[2021-11-25T15:34:18.752Z] InterviewService getConnectedCalendarWithRetry DEBUG : trying to get connected calendar again...
[2021-11-25T15:34:20.193Z] NylasService getExistingCalendars DEBUG : input arguments: { accessToken: 'eE2PqgRjrtTkPVAkGcTCpQDQB0cf8x' }
[2021-11-25T15:34:20.420Z] NylasService getExistingCalendars DEBUG : output arguments: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ]
[2021-11-25T15:34:20.421Z] NylasService getPrimaryCalendar DEBUG : input arguments: { calendars: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ] }
[2021-11-25T15:34:20.421Z] NylasService getPrimaryCalendar DEBUG : output arguments: undefined
[2021-11-25T15:34:20.421Z] InterviewService getConnectedCalendarWithRetry DEBUG : did not get connected calendar
[2021-11-25T15:34:20.421Z] InterviewService getConnectedCalendarWithRetry DEBUG : trying to get connected calendar again...
[2021-11-25T15:34:22.150Z] NylasService getExistingCalendars DEBUG : input arguments: { accessToken: 'eE2PqgRjrtTkPVAkGcTCpQDQB0cf8x' }
[2021-11-25T15:34:22.678Z] NylasService getExistingCalendars DEBUG : output arguments: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ]
[2021-11-25T15:34:22.678Z] NylasService getPrimaryCalendar DEBUG : input arguments: { calendars: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ] }
[2021-11-25T15:34:22.678Z] NylasService getPrimaryCalendar DEBUG : output arguments: undefined
[2021-11-25T15:34:22.678Z] InterviewService getConnectedCalendarWithRetry DEBUG : did not get connected calendar
[2021-11-25T15:34:22.678Z] InterviewService getConnectedCalendarWithRetry DEBUG : trying to get connected calendar again...
[2021-11-25T15:34:24.753Z] NylasService getExistingCalendars DEBUG : input arguments: { accessToken: 'eE2PqgRjrtTkPVAkGcTCpQDQB0cf8x' }
[2021-11-25T15:34:24.994Z] NylasService getExistingCalendars DEBUG : output arguments: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ]
[2021-11-25T15:34:24.995Z] NylasService getPrimaryCalendar DEBUG : input arguments: { calendars: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ] }
[2021-11-25T15:34:24.995Z] NylasService getPrimaryCalendar DEBUG : output arguments: undefined
[2021-11-25T15:34:24.995Z] InterviewService getConnectedCalendarWithRetry DEBUG : did not get connected calendar
[2021-11-25T15:34:24.995Z] InterviewService getConnectedCalendarWithRetry DEBUG : trying to get connected calendar again...
[2021-11-25T15:34:27.485Z] NylasService getExistingCalendars DEBUG : input arguments: { accessToken: 'eE2PqgRjrtTkPVAkGcTCpQDQB0cf8x' }
[2021-11-25T15:34:27.943Z] NylasService getExistingCalendars DEBUG : output arguments: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ]
[2021-11-25T15:34:27.943Z] NylasService getPrimaryCalendar DEBUG : input arguments: { calendars: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ] }
[2021-11-25T15:34:27.943Z] NylasService getPrimaryCalendar DEBUG : output arguments: undefined
[2021-11-25T15:34:27.944Z] InterviewService getConnectedCalendarWithRetry DEBUG : did not get connected calendar
[2021-11-25T15:34:27.944Z] InterviewService getConnectedCalendarWithRetry DEBUG : trying to get connected calendar again...
[2021-11-25T15:34:30.930Z] NylasService getExistingCalendars DEBUG : input arguments: { accessToken: 'eE2PqgRjrtTkPVAkGcTCpQDQB0cf8x' }
[2021-11-25T15:34:31.158Z] NylasService getExistingCalendars DEBUG : output arguments: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ]
[2021-11-25T15:34:31.158Z] NylasService getPrimaryCalendar DEBUG : input arguments: { calendars: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ] }
[2021-11-25T15:34:31.158Z] NylasService getPrimaryCalendar DEBUG : output arguments: undefined
[2021-11-25T15:34:31.159Z] InterviewService getConnectedCalendarWithRetry DEBUG : did not get connected calendar
[2021-11-25T15:34:31.159Z] InterviewService getConnectedCalendarWithRetry DEBUG : trying to get connected calendar again...
[2021-11-25T15:34:34.742Z] NylasService getExistingCalendars DEBUG : input arguments: { accessToken: 'eE2PqgRjrtTkPVAkGcTCpQDQB0cf8x' }
[2021-11-25T15:34:34.964Z] NylasService getExistingCalendars DEBUG : output arguments: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ]
[2021-11-25T15:34:34.964Z] NylasService getPrimaryCalendar DEBUG : input arguments: { calendars: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ] }
[2021-11-25T15:34:34.964Z] NylasService getPrimaryCalendar DEBUG : output arguments: undefined
[2021-11-25T15:34:34.964Z] InterviewService getConnectedCalendarWithRetry DEBUG : did not get connected calendar
[2021-11-25T15:34:34.964Z] InterviewService getConnectedCalendarWithRetry DEBUG : trying to get connected calendar again...
[2021-11-25T15:34:39.268Z] NylasService getExistingCalendars DEBUG : input arguments: { accessToken: 'eE2PqgRjrtTkPVAkGcTCpQDQB0cf8x' }
[2021-11-25T15:34:39.491Z] NylasService getExistingCalendars DEBUG : output arguments: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ]
[2021-11-25T15:34:39.491Z] NylasService getPrimaryCalendar DEBUG : input arguments: { calendars: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ] }
[2021-11-25T15:34:39.491Z] NylasService getPrimaryCalendar DEBUG : output arguments: undefined
[2021-11-25T15:34:39.491Z] InterviewService getConnectedCalendarWithRetry DEBUG : did not get connected calendar
[2021-11-25T15:34:39.491Z] InterviewService getConnectedCalendarWithRetry DEBUG : trying to get connected calendar again...
[2021-11-25T15:34:44.652Z] NylasService getExistingCalendars DEBUG : input arguments: { accessToken: 'eE2PqgRjrtTkPVAkGcTCpQDQB0cf8x' }
[2021-11-25T15:34:44.927Z] NylasService getExistingCalendars DEBUG : output arguments: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ]
[2021-11-25T15:34:44.927Z] NylasService getPrimaryCalendar DEBUG : input arguments: { calendars: [ { account_id: '22rsvnmpboum0sg7ghleopu0c', description: 'Emailed events', id: 'a43azcl6wr5buqknxuibd4tfd', is_primary: null, location: null, name: 'Emailed events', object: 'calendar', read_only: true, timezone: null } ] }
[2021-11-25T15:34:44.927Z] NylasService getPrimaryCalendar DEBUG : output arguments: undefined
[2021-11-25T15:34:44.927Z] InterviewService getConnectedCalendarWithRetry DEBUG : did not get connected calendar
maxceem commented 2 years ago

This was fixed together with https://github.com/topcoder-platform/taas-app/issues/580 and https://github.com/topcoder-platform/taas-app/issues/588 and ready for QA.

sdgun commented 2 years ago

Verified in dev env, issue is fixed.

https://user-images.githubusercontent.com/4592712/146886242-0feea76c-6cce-409c-86d3-e506327170b7.mp4

sdgun commented 2 years ago

Removing the milestone since this feature was disabled in the current production release https://github.com/topcoder-platform/taas-app/issues/598