Skip to content

[Bug]: Google Calendar connect/sync in Interview Prep is dead on arrival - frontend calls /api/google-calendar/* routes the backend never mounts #1793

Description

@ionfwsrijan

Description

The Interview Prep page ships Google Calendar connect/sync functionality in the frontend, but the backend has no /api/google-calendar/* routes at all. Every calendar action always fails.

Frontend call sites:

  • frontend/src/utils/apiPaths.js:38-43 defines GOOGLE_CALENDAR.CONNECT (GET /api/google-calendar/connect), CALLBACK, STATUS (GET /api/google-calendar/status), and EVENTS (POST /api/google-calendar/sync-events).
  • frontend/src/pages/InterviewPrep/InterviewPrep.jsx:98 calls axiosInstance.get(GOOGLE_CALENDAR.CONNECT) when the user clicks "Connect your Google Calendar".
  • frontend/src/pages/InterviewPrep/InterviewPrep.jsx:112 calls axiosInstance.post(GOOGLE_CALENDAR.EVENTS, ...) to sync a session's questions as calendar events.
  • frontend/src/pages/InterviewPrep/InterviewPrep.jsx:132 calls axiosInstance.get(GOOGLE_CALENDAR.STATUS) on mount to show whether the calendar is linked.

Backend evidence: backend/server.js mounts auth, sessions, question, ai, questions, sheets, user, resume, notes-summary, books, jobs, courses, flashcards, roadmaps, and interview-experiences routes — but no Google Calendar route, and a repo-wide search for google-calendar / google_calendar / googleCalendar returns zero backend files.

Expected Behavior

Clicking "Connect your Google Calendar" should start an OAuth2 flow, the callback should exchange the code and persist the refresh token, GET /status should report the linked account, and "Sync to Google Calendar" should create events for the user's interview prep tasks.

Actual Behavior

  • Every page load fires GET /api/google-calendar/status against a route that does not exist; Express returns its default 404 HTML body, and InterviewPrep.jsx:132's .catch logs Calendar status error every time.
  • Clicking Connect fires GET /api/google-calendar/connect, which 404s; the UI toast shows "Unable to connect Google Calendar".
  • Clicking Sync fires POST /api/google-calendar/sync-events, which 404s; the UI toast shows "Unable to sync Google Calendar event".
  • The calendar banner permanently shows the "Connect your Google Calendar" empty state — the feature is unusable but still rendered and still making failing network calls on every visit.

Proposed Fix

Either implement the backend (preferred, multi-file):

  • Add backend/routes/googleCalendarRoutes.js with GET /connect (start OAuth2), GET /callback (exchange code, persist refresh token per user), GET /status, and POST /sync-events (create events for session questions).
  • Add the corresponding controller with an OAuth2 client (scopes https://www.googleapis.com/auth/calendar.events), secure storage of the refresh token (e.g. encrypted, user-scoped), and mount it in server.js as app.use("/api/google-calendar", generalLimiter, googleCalendarRoutes).
  • Keep the frontend call sites as-is and gate the banner on the real /status response.

Or remove the dead feature until the backend exists: delete the three call sites and the calendar banner, or at minimum stop firing the failing /status request on every page load.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions