fix: handle categories, recurrence_rule, attendees, and reminder_minutes in update_event#545
Conversation
…tes in update_event _merge_ical_properties() only handled a subset of event fields, silently dropping categories, recurrence_rule, attendees, and reminder_minutes during updates. These fields were fully supported by _create_ical_event() and accepted by the MCP tool, but never applied. Closes #544 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code ReviewGreat work on this fix! This PR correctly addresses issue #544 by implementing the missing field handlers in ✅ Strengths
🔍 Minor Observations1. Categories Whitespace Handling (calendar.py:819)The current implementation: component["CATEGORIES"] = categories_str.split(",")Consideration: Should we strip whitespace from category names? For example, Comparison:
Verdict: ✅ Consistent with existing code. If whitespace handling is desired, it should be addressed separately across all methods. 2. Recurrence Rule Validation (calendar.py:827)component["RRULE"] = vRecur.from_ical(rrule_str)Question: Should we wrap this in a try-except to handle malformed recurrence rules gracefully? Analysis: 3. Test Assertion Specificity (test_calendar_events_mcp.py:66-84)The assertions check for string containment ( Example: If categories were set to Verdict: ✅ Acceptable for integration tests. The two-phase test (set → clear) would catch most issues. 🎯 Code Quality Assessment
🔒 Security & Performance
📋 Compliance with CLAUDE.md✅ async/await: Not applicable (synchronous iCal manipulation) 🎬 Recommendation✅ APPROVE - This PR is ready to merge. The implementation correctly fixes issue #544 by adding support for updating Optional follow-up (not blocking):
Great work! 🚀 |
Trim whitespace from comma-separated category values in all three methods: _create_ical_event, _merge_ical_properties, and _merge_ical_todo_properties. Prevents leading/trailing spaces in category names from inputs like "work, meeting". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code ReviewThank you for this PR! This is a solid fix for issue #544. The implementation correctly addresses the missing field handling in ✅ Strengths
🔍 Observations & Suggestions1. Reminder handling correctness (nextcloud_mcp_server/client/calendar.py:845-857)The implementation correctly handles VALARM clearing by filtering subcomponents before conditionally adding a new alarm. This matches the pattern in Question: Should negative 2. RRULE validation (nextcloud_mcp_server/client/calendar.py:826-831)The code uses
3. Attendee email validation (nextcloud_mcp_server/client/calendar.py:834-842)Current validation:
4. Test assertion strength (tests/client/calendar/test_calendar_operations.py:308)This assertion passes if categories is 5. Missing edge case testsConsider adding tests for:
6. DocumentationConsider updating:
🔒 SecurityNo security concerns identified:
🎯 PerformanceNo performance concerns:
📋 Checklist StatusAll checklist items completed and passing 🎯 RecommendationLGTM with minor suggestions. The core fix is correct and well-tested. The suggestions above are for future enhancements, not blockers. This PR successfully resolves issue #544. Suggested merge decision: Approve and merge after considering whether to add stricter validation (suggestion #1-2) or merge as-is with follow-up issues for edge cases. Great work on the thorough testing approach! 🎉 |
Summary
_merge_ical_properties()silently ignoringcategories,recurrence_rule,attendees, andreminder_minutesduring event updates_create_ical_event()and_merge_ical_todo_properties()Closes #544
Test plan
uv run ruff check— passesuv run ruff format --check— passesuv run ty check -- nextcloud_mcp_server— passesuv run pytest tests/client/calendar/test_calendar_operations.py -v -k "update_event"— 2 tests passuv run pytest tests/server/test_calendar_events_mcp.py -v— 1 test passes🤖 Generated with Claude Code
This PR was generated with the help of AI, and reviewed by a Human