Skip to content

같은 대화의 메일을 한 스레드로 묶어 보기 (1단계) - #71

Merged
littlebit0 merged 17 commits into
mainfrom
feat/issue-33-thread-view
Nov 26, 2026
Merged

littlebit0 merged 17 commits into
mainfrom
feat/issue-33-thread-view

Conversation

@littlebit0

@littlebit0 littlebit0 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Refs

Refs #33

배경

저장 요약에 스레드 근거 헤더가 없어 같은 대화의 메일이 한 통씩 흩어져 보였다.

변경

  • 서버: IMAP 가져오기에서 Message-ID·In-Reply-To·References·Gmail threadId(imapflow)를 저장. threading.ts가 스레드 ID 계산(Gmail ID, 없으면 References 루트, 제목은 사용 안 함). 목록 응답에 threadId·threadCount, GET /accounts/:id/threads/:threadId(시간순) 추가.
  • 클라이언트: 메일함 목록을 스레드로 묶고 통 수 표시, 대화 화면(시간순), 설정의 대화 보기 스위치(기본 켬, 앱 재시작 시 초기화).

검증

  • 서버 tsc, 테스트 26개 통과(threading 단위 테스트 추가). 클라이언트 analyze, test 통과.
  • macOS 디버그 빌드·실행으로 앱 창과 사이드바까지 확인. 빈 서버라 대화 목록 화면은 열지 못했다(계정 추가 금지).

미확인/후속

  • 실계정(Gmail·Outlook·네이버) 답장 체인 미확인. 기존 저장 메일의 스레드 정보는 동기화가 끝난 뒤 백그라운드에서 50통씩 배치로, 헤더 없는 메일이 남지 않을 때까지(배치 사이 양보) 자동 보충한다. 계정 삭제·중지 시 중단하고, 진행 상태는 저장된 메타데이터 자체라 재시작해도 이어진다(서버에 없는 메일은 빈 references로 표시해 한 번만 시도). 실계정 4,093통 규모는 미확인(테스트 서버 4,000통 시뮬레이션만 확인).
  • 보낸편지함 포함(3단계), 읽은 메일 접기, 설정 영구 저장, 서버 THREAD 확장 사용은 후속.

Message-ID·In-Reply-To·References와 Gmail 스레드 ID를 요약에 저장하고,
목록을 스레드 ID로 묶어 통 수를 표시한다. 대화를 열면 시간순으로 보여주며
설정에서 대화 보기를 끌 수 있다.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-26T19:36:42.734316Z
We couldn’t complete this review. Comment @codex review to try again.
8513cf2 New commits
🔒 Security Review ✅ Completed 2026-11-21T16:25:01.689566Z 3e0a1b4 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c34172b944

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/mail/threading.ts Resolved
Comment thread apps/server/src/api/routes.ts Resolved
@littlebit0

Copy link
Copy Markdown
Owner Author

Codex 지적 3건을 fd07017에서 반영했습니다.

@codex review

언어 (최우선)

리뷰 제목·본문·요약·지적 사항은 모두 한국어로 작성하세요.

댓글작성

지적은 문제, 재현 조건, 수정 방향 순서로 짧게 쓰세요.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd070173a1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/mail/ImapReceiver.ts Resolved
@littlebit0

Copy link
Copy Markdown
Owner Author

Codex 지적 1건을 3d6bdad에서 반영했습니다.

@codex review

언어 (최우선)

리뷰 제목·본문·요약·지적 사항은 모두 한국어로 작성하세요.

댓글작성

지적은 문제, 재현 조건, 수정 방향 순서로 짧게 쓰세요.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 3d6bdadbb3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 3d6bdadbb3

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread apps/server/src/mail/threading.ts Resolved
@littlebit0

Copy link
Copy Markdown
Owner Author

Codex 지적 1건을 3d71fdc에서 반영했습니다.

@codex review

언어 (최우선)

리뷰 제목·본문·요약·지적 사항은 모두 한국어로 작성하세요.

댓글작성

지적은 문제, 재현 조건, 수정 방향 순서로 짧게 쓰세요.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 3d71fdc998

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 3d71fdc998

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread apps/server/src/mail/threading.ts Resolved
- 동기화 뒤 헤더 없는 메일이 남아 있지 않을 때까지 배치 사이에 양보하며 계속 보충(계정 삭제·중지 시 중단, 재시작 시 이어서 진행)
- In-Reply-To 루트 해석을 Message-ID별로 메모이즈해 긴 체인의 O(n²) 제거
@littlebit0

Copy link
Copy Markdown
Owner Author

실제 macOS 앱 확인에서 나온 문제(네이버 4,093통 중 221통만 스레드 정보 보유)와 Codex 보안 지적을 bb1804d에서 반영했습니다.

  • 스레드 메타데이터 백필의 동기화당 200통 제한을 없애고, 동기화 후 백그라운드에서 50통 배치로 남은 메일이 없을 때까지 진행합니다(계정 삭제·중지 시 중단, 재시작 시 이어서 진행).
  • In-Reply-To 루트 해석을 메모이즈해 O(n)으로 바꿨습니다.

@codex review

언어 (최우선)

리뷰 제목·본문·요약·지적 사항은 모두 한국어로 작성하세요.

댓글작성

지적은 문제, 재현 조건, 수정 방향 순서로 짧게 쓰세요.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb1804d0f8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- 50통 배치를 Promise.all로 저장해 LocalFile 저장소의 쓰기 병합을 활용
- stopAccount가 진행 중인 배치 저장을 기다려 삭제 후 쓰기를 막음
- threadBackfill 상태를 노출하고 메일함이 백필 중 폴링, 완료 시 목록 재조회
- 메일함별 분류를 push로 선형화
@littlebit0

Copy link
Copy Markdown
Owner Author

Codex 지적 3건과 선제 수정 1건(PR #72의 Codex 지적 4653605715와 같은 백필 저장 성능 문제: 메시지마다 상태 파일 전체를 다시 쓰던 것을 50통 배치당 1회 병합 쓰기로 개선)을 3e0a1b4에서 반영했습니다.

@codex review

언어 (최우선)

리뷰 제목·본문·요약·지적 사항은 모두 한국어로 작성하세요.

댓글작성

지적은 문제, 재현 조건, 수정 방향 순서로 짧게 쓰세요.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 3e0a1b46ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 3e0a1b46ce

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

…view

# Conflicts:
#	apps/server/package.json
#	apps/server/src/mail/ImapReceiver.ts
#	apps/server/src/workers/MailSyncWorker.ts
#	apps/server/test/mailSyncWorker.test.ts
…view

# Conflicts:
#	apps/server/src/mail/ImapReceiver.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53ef29ad98

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/mail/ImapReceiver.ts Resolved
…view

# Conflicts:
#	apps/client/test/widget_test.dart
#	apps/server/package.json
backfill 배치마다 메일함 open 결과의 UIDVALIDITY를 받아 첫 배치 값과 비교한다.
값이 다르면 같은 UID가 다른 메일을 가리키므로 헤더를 병합하거나 backfilled로 표시하지 않고 중단한다.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…view

# Conflicts:
#	apps/server/package.json
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…view

# Conflicts:
#	apps/server/package.json
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…view

# Conflicts:
#	apps/server/package.json
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…view

# Conflicts:
#	apps/server/package.json
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…view

# Conflicts:
#	apps/server/package.json
#	apps/server/src/workers/MailSyncWorker.ts
…view

# Conflicts:
#	apps/server/package.json
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…view

# Conflicts:
#	apps/client/lib/core/i18n/language_controller.dart
#	apps/client/lib/features/accounts/account_mailbox_page.dart
#	apps/client/lib/features/settings/settings_page.dart
#	apps/client/lib/services/mail_api_client.dart
#	apps/client/test/widget_test.dart
#	apps/server/package.json
#	apps/server/src/api/routes.ts
#	apps/server/src/domain/types.ts
#	apps/server/src/mail/ImapReceiver.ts
#	apps/server/test/mailSyncWorker.test.ts
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@littlebit0
littlebit0 merged commit 3082942 into main Nov 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant