fix(mailsync): impersonation 불가 메일박스는 스킵 (동기화 전체 실패 방지)
All checks were successful
build-and-push / build (push) Successful in 32s
All checks were successful
build-and-push / build (push) Successful in 32s
멤버 목록에 개인 Gmail(theorose49@gmail.com) 등 Workspace 도메인 밖 계정이 섞여 있으면 도메인 전체 위임 token 교환이 unauthorized_client로 실패하는데, 기존엔 이 한 계정 실패가 firstErr로 잡혀 프로젝트 전체 동기화가 오류로 마크됐다(나머지 멤버 메일은 정상 수집됐는데도). 이제 해당 메일박스만 로그 남기고 건너뛴다. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
654f17d487
commit
4dac89e313
@ -163,6 +163,14 @@ func (s *Service) FetchForDomain(ctx context.Context, mailboxes []string, domain
|
||||
if box == "" {
|
||||
continue
|
||||
}
|
||||
// 도메인 전체 위임은 이 서비스계정이 속한 Workspace 도메인 사용자만 impersonate 가능.
|
||||
// 멤버 목록에 섞인 개인 Gmail(@gmail.com)이나 아직 프로비저닝 안 된 계정은
|
||||
// token 교환이 unauthorized_client로 실패한다. 그 메일박스만 건너뛰고, 프로젝트
|
||||
// 전체 동기화를 실패로 마크하지 않는다(나머지 멤버 메일은 정상 수집).
|
||||
if _, err := s.accessToken(ctx, box); err != nil {
|
||||
log.Printf("mailsync: 메일박스 %s 건너뜀 (impersonation 불가): %v", box, err)
|
||||
continue
|
||||
}
|
||||
pageToken := ""
|
||||
fetched := 0
|
||||
for {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user