fix(gmail): include Cc, Bcc and Reply-To in gmail.get responses#389
fix(gmail): include Cc, Bcc and Reply-To in gmail.get responses#389mickey-mikey wants to merge 5 commits into
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 GmailService to extract Cc, Bcc, and Reply-To headers from emails, ensuring case-insensitive header matching per RFC 5322, and adds comprehensive unit tests for these scenarios. The review feedback suggests a performance optimization in the getHeader helper function to convert the target header name to lowercase once outside the search loop, avoiding redundant operations.
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.
gmail.get silently dropped the Cc, Bcc and Reply-To headers in both "metadata" and "full" formats, so callers could not see who an email was copied to without falling back to format "raw" and decoding the RFC 822 message themselves. Also make header-name matching case-insensitive per RFC 5322.
93aae7a to
e507396
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for extracting 'Cc', 'Bcc', and 'Reply-To' headers from Gmail messages, handling header names case-insensitively, and includes corresponding unit tests. The feedback suggests optimizing the header lookup by building a case-insensitive lookup Map instead of performing repeated linear scans, and simplifying the conditional property spreading since JSON.stringify automatically omits undefined values.
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.
…fined omission Addresses review feedback: O(N+M) header lookups via a lowercased Map instead of repeated linear scans, and plain property passing instead of conditional spreads since JSON.stringify already omits undefined values.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates GmailService to extract Cc, Bcc, and Reply-To headers from Gmail messages, ensuring case-insensitive header matching per RFC 5322. It also adds corresponding unit tests. Feedback suggests using h.value != null instead of h.value !== undefined to prevent null values from being serialized in the final JSON response.
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.
gmail_v1.Schema$MessagePartHeader.value is string | null | undefined; filtering with != null keeps null-valued headers out of the map so they are omitted from the JSON response rather than serialised as null. Tightens the map type to Map<string, string>.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates GmailService to extract Cc, Bcc, and Reply-To headers, and implements case-insensitive header matching using a Map to comply with RFC 5322. It also adds comprehensive unit tests for these changes. The review feedback correctly notes that the new Map implementation unconditionally overwrites duplicate headers, shifting the behavior from "first match wins" to "last match wins". To maintain backward compatibility, it is recommended to only set the header value if the key is not already present in the map.
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.
headers.find() returned the first matching header; the lookup map was overwriting on duplicates, silently switching to last-match-wins. Skip set() when the key already exists, with a test pinning the behaviour.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the GmailService to extract additional email headers (Cc, Bcc, and Reply-To) and processes header names case-insensitively per RFC 5322. It also adds comprehensive unit tests to verify the extraction logic, including handling of missing, null, duplicate, and case-insensitive headers. 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.
Fixes #388.
Problem
gmail.getextracted onlySubject,From,ToandDatefor themetadataandfullformats, silently discardingCc,BccandReply-To. Consumers could not tell who a message was copied to without falling back toformat: "raw"and decoding the RFC 822 payload themselves — and the absence of accfield reads as "no CC recipients", which is confidently wrong.Changes
Cc,BccandReply-Toin themetadata/fullpaths and include them in the response ascc,bcc,replyTo— omitted when the header is absent, so existing response shapes are unchanged for messages without them.Tests
nulls); case-variant header names (from/TO/CC) still match.🤖 Generated with Claude Code