Skip to content

refactor: simplify code and reduce duplication#110

Merged
Wh1isper merged 2 commits intoai-zerolab:mainfrom
jbkjr:improvement/code-simplification
Feb 14, 2026
Merged

refactor: simplify code and reduce duplication#110
Wh1isper merged 2 commits intoai-zerolab:mainfrom
jbkjr:improvement/code-simplification

Conversation

@jbkjr
Copy link
Contributor

@jbkjr jbkjr commented Jan 25, 2026

Summary

  • Fix typo: DEFAILT_CONFIG_PATH -> DEFAULT_CONFIG_PATH
  • Consolidate duplicate _parse_bool_env functions into one module-level function
  • Remove unnecessary return statement in store_settings
  • Have EmailBodyResponse extend EmailMetadata to avoid field duplication
  • Add in_reply_to and references params to abstract send_email interface to match implementation
  • Extract _parse_recipients and _parse_date helper methods in EmailClient to reduce code duplication
  • Add MAX_BODY_LENGTH constant instead of magic number 20000
  • Add missing return type annotation to _build_search_criteria

Test plan

  • All existing tests pass (130 tests)

🤖 Generated with Claude Code

Jack Koch and others added 2 commits January 25, 2026 10:32
- Fix typo: DEFAILT_CONFIG_PATH -> DEFAULT_CONFIG_PATH
- Consolidate duplicate _parse_bool_env functions into one
- Remove unnecessary `return` statement in store_settings
- Have EmailBodyResponse extend EmailMetadata to avoid field duplication
- Add in_reply_to and references params to abstract send_email interface
- Extract _parse_recipients and _parse_date helper methods in EmailClient
- Add MAX_BODY_LENGTH constant instead of magic number
- Add missing return type annotation to _build_search_criteria

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

❌ Patch coverage is 87.87879% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
mcp_email_server/emails/classic.py 84.6% 3 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

jbkjr pushed a commit to jbkjr/mcp-email-server that referenced this pull request Jan 25, 2026
Apply improvements from upstream PR ai-zerolab#110:
- Fix typo: DEFAILT_CONFIG_PATH -> DEFAULT_CONFIG_PATH
- Consolidate duplicate _parse_bool_env functions into one
- Remove unnecessary `return` statement in store_settings
- Have EmailBodyResponse extend EmailMetadata to avoid field duplication
- Add in_reply_to and references params to abstract send_email interface
- Extract _parse_recipients and _parse_date helper methods in EmailClient
- Add MAX_BODY_LENGTH constant instead of magic number
- Add missing return type annotation to _build_search_criteria

Additional improvements for local-dev extra features:
- Add LABELS_PREFIX constant for ProtonMail label paths
- Remove redundant `import re` inside search_by_message_id method

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Wh1isper Wh1isper merged commit fce15ad into ai-zerolab:main Feb 14, 2026
9 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.

2 participants