fix: Codex 리뷰 P1/P2 버그 4건 수정
- [P1] migration runner 도입: schema_migrations 추적, advisory lock, 단일 트랜잭션 실행, SQL 검증 (기존 DB 업그레이드 대응) - [P1] eml extract 큐 조건 분기: extract_worker 미지원 포맷 큐 스킵 - [P2] iCalendar escape_ical_text() 추가: RFC 5545 준수 - [P2] 이메일 charset 감지: get_content_charset() 사용 + payload None 방어 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,20 @@ def count_log_errors(log_path: str) -> int:
|
||||
# ─── CalDAV 헬퍼 ───
|
||||
|
||||
|
||||
def escape_ical_text(text: str | None) -> str:
|
||||
"""iCalendar TEXT 값 이스케이프 (RFC 5545 §3.3.11).
|
||||
SUMMARY, DESCRIPTION, LOCATION 등 TEXT 프로퍼티에 사용.
|
||||
"""
|
||||
if not text:
|
||||
return ""
|
||||
text = text.replace("\r\n", "\n").replace("\r", "\n") # CRLF 정규화
|
||||
text = text.replace("\\", "\\\\") # 백슬래시 먼저
|
||||
text = text.replace("\n", "\\n")
|
||||
text = text.replace(",", "\\,")
|
||||
text = text.replace(";", "\\;")
|
||||
return text
|
||||
|
||||
|
||||
def create_caldav_todo(
|
||||
caldav_url: str,
|
||||
username: str,
|
||||
@@ -79,8 +93,8 @@ def create_caldav_todo(
|
||||
VERSION:2.0
|
||||
BEGIN:VTODO
|
||||
UID:{uid}
|
||||
SUMMARY:{title}
|
||||
DESCRIPTION:{description}
|
||||
SUMMARY:{escape_ical_text(title)}
|
||||
DESCRIPTION:{escape_ical_text(description)}
|
||||
DUE:{due_str}
|
||||
STATUS:NEEDS-ACTION
|
||||
PRIORITY:5
|
||||
|
||||
Reference in New Issue
Block a user