Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## [Unreleased]
- PostgreSQL bootstrap now creates the owner/date index only on the canonical
`email_records` table after email-model reconciliation, and real smoke seeds
provide the required `is_read` state. Fresh-schema bootstrap and data-quality
smoke checks no longer fail on the removed legacy `emails` table.
- 긴 이메일·첨부 본문을 의미 단위 청크로 임베딩한 뒤 기존 email/attachment 벡터 계약으로 평균화하고, 청크 요청·벡터 누적을 제한된 창으로 처리합니다. OpenAI `text-embedding-3-*`에는 저장 차원(`1536`)을 직접 요청하도록 보강했습니다. 합성 메일 fixture 5건(70청크)과 provider 요청 계약으로 1,536차원 벡터 경로를 검증했으며, 실행 시 선택한 임베딩 제공자에 본문·파싱된 첨부 텍스트를 전송할 수 있습니다. 회사 기밀 데이터는 fixture·commit·PR·log에 포함하지 않습니다.
- EmailDetail 테스트가 지원하지 않는 스레드 병합/분리 버튼을 `textContent`뿐 아니라 `aria-label`과 `title` 접근 가능 이름으로도 검출하도록 바꿔, 아이콘 전용 버튼 회귀를 놓치지 않습니다.

Expand Down
4 changes: 0 additions & 4 deletions backend/scripts/bootstrap_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,6 @@ def _get_create_indexes_statements() -> list[Executable]:
"CREATE INDEX IF NOT EXISTS ix_email_records_owner_date "
"ON email_records (user_id, organization_id, date)"
),
text(
"CREATE INDEX IF NOT EXISTS ix_emails_owner_date "
"ON emails (user_id, organization_id, date)"
),
text(
"CREATE INDEX IF NOT EXISTS ix_sender_relationships_owner_source "
"ON sender_relationships "
Expand Down
8 changes: 6 additions & 2 deletions backend/tests/test_bootstrap_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ def test_schema_backfill_adds_email_indexes(monkeypatch):
and "user_id, organization_id, date" in statement
for statement in statements
)
assert not any(
"on emails (user_id, organization_id, date)" in statement
for statement in statements
)
assert any(
"drop index if exists ix_email_records_message_id" in statement
for statement in statements
Expand Down Expand Up @@ -770,11 +774,11 @@ async def test_connector_signal_events_real_postgres_bootstrap_smoke():
text("""
INSERT INTO email_records (
user_id, organization_id, message_id, sender, recipients,
subject, "date", body
subject, "date", body, is_read
)
VALUES (
:user_id, :organization_id, :message_id, :sender,
:recipients, :subject, now(), :body
:recipients, :subject, now(), :body, true
)
RETURNING id
"""),
Expand Down
12 changes: 6 additions & 6 deletions backend/tests/test_data_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2951,11 +2951,11 @@ async def _seed_smoke_test_data(conn, ids: dict):
"""
INSERT INTO email_records (
user_id, organization_id, message_id, thread_id,
fingerprint, sender, recipients, subject, "date", body
fingerprint, sender, recipients, subject, "date", body, is_read
)
VALUES (
:user_id, :organization_id, :message_id, :thread_id,
:fingerprint, :sender, :recipients, :subject, now(), :body
:fingerprint, :sender, :recipients, :subject, now(), :body, true
)
RETURNING id
"""
Expand All @@ -2977,11 +2977,11 @@ async def _seed_smoke_test_data(conn, ids: dict):
"""
INSERT INTO email_records (
user_id, organization_id, message_id, sender, recipients,
subject, "date", body
subject, "date", body, is_read
)
VALUES (
:user_id, :organization_id, :message_id, :sender,
:recipients, :subject, now(), :body
:recipients, :subject, now(), :body, true
)
RETURNING id
"""
Expand All @@ -3001,11 +3001,11 @@ async def _seed_smoke_test_data(conn, ids: dict):
"""
INSERT INTO email_records (
user_id, organization_id, message_id, thread_id,
fingerprint, sender, recipients, subject, "date", body
fingerprint, sender, recipients, subject, "date", body, is_read
)
VALUES (
:user_id, :organization_id, :message_id, :thread_id,
:fingerprint, :sender, :recipients, :subject, now(), :body
:fingerprint, :sender, :recipients, :subject, now(), :body, true
)
RETURNING id
"""
Expand Down
Loading