fix: enterprise SAML emails lost on warm-start re-sync#140
fix: enterprise SAML emails lost on warm-start re-sync#140madison-c-evans merged 1 commit intomainfrom
Conversation
|
Claude finished @madison-c-evans's task in 1m 37s —— View job PR Review: fix: enterprise SAML emails lost on warm-start re-sync
ReviewOverall: This is a well-targeted fix for two real bugs that interact to silently drop enterprise SAML emails. The root causes are clearly identified and the fixes are appropriate. Approving with one observation and one minor concern. Fix 1: Remove
|
2596990 to
5d97fad
Compare
|
Claude finished @madison-c-evans's task in 1m 18s —— View job PR Review: fix: enterprise SAML emails lost on warm-start re-sync
Overall: Both bugs are real, well-diagnosed, and correctly fixed. The changes are minimal and targeted. LGTM. Fix 1: Remove
|
…m restarts The enterpriseSAMLFetched struct flag persisted across sync cycles when the connector stayed warm (Lambda warm start), but the session store is scoped per SyncID. On the second sync the flag said "already fetched" while the session was empty, silently dropping all SAML emails. Replace the struct flag with a session-based sentinel: the presence of the enterpriseSAMLKeysIndex key in the current sync's session indicates whether we already fetched. Also always write the key index (even when empty) so the sentinel works when there are zero SAML mappings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5d97fad to
218ec2c
Compare
|
Claude finished @madison-c-evans's task in 1m 33s —— View job PR Review: fix: enterprise SAML emails lost on warm-start re-sync
ReviewOverall: This is a clean, well-targeted fix for a real warm-start bug. The session-based sentinel approach is the correct pattern. LGTM. What changedThe Bug analysisThe root cause is clear: on Lambda warm starts, the
The fix replaces the struct flag with Key correctness details
Pre-existing:
|
Summary
enterpriseLicensesAvailablegate from ResourceSyncers — the SDK callsResourceSyncers()beforeValidate(), so the gate was always false and enterprises were never passed to the user builderenterpriseSAMLFetchedstruct flag persisted across sync cycles on Lambda warm starts, but the session store is scoped per SyncID. On the second sync the flag said "already fetched" while the session was empty, silently dropping all SAML emails. Replaced with a session-based sentinel (presence ofenterpriseSAMLKeysIndexin the current sync's session)Test plan
go build ./cmd/baton-githubcompiles cleango test ./...passes🤖 Generated with Claude Code