Match Google Meet conferences to calendar events

Merged
EH
2d ago
+496-0

Context

Seventh PR of the Google Meet app, following #30587 (app shell), #30588 (test setup), #30589 (Google OAuth connection), #30590 (Meet API client), #30591 (transcript, entry and participant listing) and #30592 (transcript mapping). The app will import Google Meet recordings, transcripts and Gemini notes into Call Recordings, the same way the Teams, Fathom and Granola apps do. The full sequence of PRs is listed in #30587.

A Call Recording is linked to a calendar event through calendarEventId, which is how its participants and meeting show up in Twenty. This PR adds the code that finds that calendar event. Nothing calls it yet: the import in a following PR is its first user.

What this PR does

  • getGoogleMeetSpace: reads the meeting space of a conference, which carries its Meet link (meetingUri).
  • findGoogleMeetCalendarEvent: returns the id and title of the calendar event a conference belongs to, or nothing.
    • It compares the normalized Meet link with calendarEvent.conferenceLink, the field the core calendar sync fills from Google Calendar.
    • Recurring meetings reuse one link, so among events with that link it takes the one starting closest to the conference start, within one hour either side.
    • When two events are equally close it matches neither, and when the window cannot be read to the end it matches nothing, so a recording is never attached to the wrong meeting.
  • listCalendarEventsInWindow: lists live calendar events starting in a window whose conference link contains the Meet code. The code is filtered on the server with an escaped ilike, so a busy workspace does not exhaust the page limit; the exact comparison on the normalized link stays in findGoogleMeetCalendarEvent.
  • normalizeMeetingUrl and escapeSqlLikePattern: same helpers as the Fathom and Teams apps.

The Meet API does not expose the scheduled time of a meeting, only when the first participant joined, which is why the window is one hour rather than Fathom's five minutes. A call started more than an hour off schedule stays unlinked.

Checks

Run locally in the app folder: yarn install --immutable, yarn lint, yarn typecheck, yarn test:unit (42 tests) and the repo formatter pass. The app role cannot read calendar events yet; that permission comes with the import PR that uses this code.