Skip to content

Commit 906889e

Browse files
waleedlatif1claude
andcommitted
fix(search): keep untitled Calendar meetings that name a room or attendees
Only an event with no title, description, location, organizer and no attendees is the bare time block a free/busy reader receives. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 2c1e747 commit 906889e

2 files changed

Lines changed: 36 additions & 3 deletions

File tree

apps/sim/connectors/google-calendar/google-calendar.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,31 @@ describe('Google Calendar Search isolation', () => {
189189
expect(restricted.documents[0].metadata?.organizer).toBe('')
190190
})
191191

192+
it('keeps an untitled meeting that still names a room or its participants', async () => {
193+
fetchMock.mockResolvedValueOnce(
194+
jsonResponse({
195+
items: [
196+
{ ...EVENT, id: 'room', summary: undefined, description: undefined },
197+
{
198+
...EVENT,
199+
id: 'bare-location',
200+
summary: undefined,
201+
description: undefined,
202+
organizer: undefined,
203+
attendees: undefined,
204+
},
205+
],
206+
})
207+
)
208+
const result = await googleCalendarConnector.listDocuments('token', {}, undefined, alice)
209+
expect(result.documents.map((doc) => doc.externalId)).toEqual([
210+
expect.stringContaining('room'),
211+
expect.stringContaining('bare-location'),
212+
])
213+
expect(result.documents[0].content).toContain(ATTENDEE_NAME)
214+
expect(result.documents[1].content).toContain(EVENT.location)
215+
})
216+
192217
it('withdraws a free/busy time block that carries no title or description', async () => {
193218
fetchMock.mockResolvedValueOnce(
194219
jsonResponse({

apps/sim/connectors/google-calendar/google-calendar.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,21 @@ function memberResponseStatus(event: CalendarEvent): string | undefined {
147147
/**
148148
* Whether the event carries something to search. Status entries (working
149149
* location, out of office, focus time, birthdays) describe availability rather
150-
* than a meeting, and a reader with free/busy access alone sees a time block
151-
* with no title or description.
150+
* than a meeting. A reader with free/busy access alone receives a bare time
151+
* block: Google strips the title, description, location, organizer and
152+
* attendees, so an event with none of those is that placeholder. An untitled
153+
* meeting that still names a room or its participants stays indexed.
152154
*/
153155
function isSearchableEvent(event: CalendarEvent): boolean {
154156
if (event.status === 'cancelled') return false
155157
if (event.eventType && event.eventType !== INDEXED_EVENT_TYPE) return false
156-
return Boolean(event.summary?.trim() || event.description?.trim())
158+
return Boolean(
159+
event.summary?.trim() ||
160+
event.description?.trim() ||
161+
event.location?.trim() ||
162+
event.organizer ||
163+
(event.attendees && event.attendees.length > 0)
164+
)
157165
}
158166

159167
/**

0 commit comments

Comments
 (0)