fix(calendar): include attachments in listEvents field mask - #383
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request updates the CalendarService to request and pass through native event attachments when listing calendar events. Specifically, the fields parameter in the listEvents API call is updated to include attachment details (fileId, fileUrl, title, mimeType, iconLink). Additionally, corresponding unit tests have been updated and a new test case has been added to verify this behavior. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
events.list only returns fields named in `fields`. The listEvents mask omitted attachments, so native event attachments were silently dropped — even though getEvent returns them (no field mask) and createEvent/updateEvent fully support them. Add attachments(fileId,fileUrl,title,mimeType,iconLink) to align listEvents with the rest of CalendarService. Reading attachments needs no supportsAttachments flag (that is write-only). Tests: assert the mask requests attachments and that an attachment's fileId survives into the tool payload; updated the two existing field-mask assertions.
c2874f2 to
0392852
Compare
allenhutchison
left a comment
There was a problem hiding this comment.
Thanks for fixing this.
What
listEventsrequests an explicitfieldsmask, and that mask omittedattachments. Becauseevents.listonly returns fields named in the mask, native event attachments were silently dropped from everylistEventsresult.This adds
attachments(fileId,fileUrl,title,mimeType,iconLink)to the mask.Why this is a consistency fix, not a new feature
Every other calendar method in
CalendarServicealready exposes/handles attachments —listEventswas the lone exception:getEventcallsevents.getwith no field mask, so it already returns attachments.createEvent/updateEventfully support attachments via theEventAttachmentinterface andapplyMeetAndAttachments(supportsAttachments).So a caller can create an event with an attachment and read it back via
getEvent, but the same attachment vanishes when the event is fetched throughlistEvents. This change alignslistEventswith the rest of the service.Note: reading attachments needs no
supportsAttachmentsparameter — that flag is write-only (insert/update/patch). Adding the field to the read mask is sufficient.Impact
fieldsmask; no change to any existing field or to request/response shapes beyond the newattachmentsarray.listEventspayloads when events carry attachments.Testing
events.listfield mask includesattachments(and that an attachment'sfileIdsurvives into the tool payload.