Compare Gmail addresses the way Gmail does in the groups sync - #59
Merged
Merged
Conversation
Gmail ignores dots and anything after a +, and googlemail.com is gmail.com, so h.smith@gmail.com and hsmith@gmail.com are one account. Google Groups keeps such a member under the account's own spelling. P0063's parent is on the sheet with a dot and in grp-parents without one, so every hourly run "added" them again (Google answered "already a member", which counts as success) and held the group's spelling as an address nobody lists (#142, open since the first apply on 2026-09-28). `addressKey` compares Gmail addresses without dots, +tags or googlemail, and every other domain lower-cased and otherwise as written. It is used only to compare: an add still sends the sheet's spelling, and a removal the group's. The groups planner and the offboarding planner use it, so the step 7 warnings agree. After deploy, the next hourly groups run stops re-adding P0063's parent and closes #142 as no longer held. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
willtoth
approved these changes
Sep 29, 2026
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while reading open findings with Rachel on 2026-09-29. Separate from the step 7 pull requests, because it fixes something that repeats every hour today.
The loop
Gmail ignores dots (and anything after a
+, and treatsgooglemail.comasgmail.com), soh.smith@gmail.comandhsmith@gmail.comare one account. Google Groups keeps such a member under the account's own spelling, whichever was added.P0063's parent is on the sheet with a dot and sits in grp-parents without one (Rachel checked; she confirmed it is a dot, without sharing the address). So since the first apply on 2026-09-28:
addMembercounts as success;Harmless — the parent was in the group throughout — but a Remove from groups click on #142 would have removed them only for the next run to add them back.
The fix
domain/lifecycle/address.ts:addressKeycompares Gmail addresses without dots,+tagsorgooglemail, and every other domain lower-cased and otherwise as written — whether dots matter elsewhere is that domain's business, and guessing could merge two different people. It is only for comparing: a join still sends the sheet's spelling, a removal the group's.Used by the groups planner (
groupPlan.ts) and the offboarding planner (offboarding.ts), so the step 7 warnings agree with it. Two students listing one parent spelled two ways are one parent.After deploy, the next hourly groups run stops re-adding P0063's parent and closes #142 as no longer held — no sheet edit needed.
Tests
test/gmailAddresses.test.ts(6); two of them fail onmainwithout the fix.npm run typecheck && npm test && npm run format:check && npm run buildpass (824 tests). Merges independently of #57 and #58 (checked).🤖 Generated with Claude Code