Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bounty proposal] fix(calendar): normalize naive dateTime strings and guard None values in parse_event_times ($50 proposed)

Open Beginner friendly
#22,636 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@huynhnhatquandongnai-source is already working on this.

Since Oct 19, 2026.

  • #22637 by @huynhnhatquandongnai-source — open
  • #22651 by @lecapable4 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Read backend/utils/conversations/calendar_utils.py and the overlap paths in backend/utils/conversations/calendar_linking.py named in the issue. Then inspect backend/tests/unit/test_calendar_linking_overlap_selection.py and reproduce the naive datetime and dateTime: None cases. Done means both cases are handled without comparison or parsing errors and the regression tests pass.

Written by the indexing model from the issue text.

Description

Summary

parse_event_times(event) in backend/utils/conversations/calendar_utils.py parses start['dateTime'] and end['dateTime'] via datetime.fromisoformat(str(start['dateTime']).replace('Z', '+00:00')) without normalizing timezone-naive datetimes to UTC, while all-day date events are constructed with +00:00 (offset-aware UTC).

When a Google Calendar feed contains a floating-time or ICS-imported event whose start.dateTime / end.dateTime lacks a UTC offset (e.g. "2026-08-18T19:30:00"), parse_event_times returns offset-naive datetime objects (tzinfo=None). Downstream callers that compare those event bounds against timezone-aware UTC conversation bounds (select_overlapping_calendar_event at backend/utils/conversations/calendar_linking.py:103-104 and select_capture_gaps at backend/utils/conversations/calendar_linking.py:166) crash with TypeError: can't compare offset-naive and offset-aware datetimes.

Additionally, if start or end carries an explicit {"dateTime": None, "date": "2026-08-18"}, 'dateTime' in start evaluates to True and str(None) fails fromisoformat("None") instead of falling through to the 'date' branch.

Exact Code Locations
  • backend/utils/conversations/calendar_utils.py:18-33:
if 'dateTime' in start:
    start_dt = datetime.fromisoformat(str(start['dateTime']).replace('Z', '+00:00'))
elif 'date' in start:
    start_dt = datetime.fromisoformat(str(start['date']) + 'T00:00:00+00:00')
  • backend/utils/conversations/calendar_linking.py:99-105 (select_overlapping_calendar_event):
event_start, event_end = parse_event_times(event)
...
overlap_start = max(event_start, conversation_start)
overlap_end = min(event_end, conversation_end)
  • backend/utils/conversations/calendar_linking.py:159-168 (select_capture_gaps):
event_start, event_end = parse_event_times(event)
...
covered = any(
    (min(event_end, window_end) - max(event_start, window_start)).total_seconds() >= MIN_OVERLAP_SECONDS
    for window_start, window_end in conversation_windows
)
Concrete Reproduction & Crash Traceback
from datetime import datetime, timezone
from utils.conversations.calendar_linking import select_overlapping_calendar_event

floating_event = {
    "id": "evt-floating",
    "summary": "Floating Sync",
    "status": "confirmed",
    "start": {"dateTime": "2026-08-18T19:30:00"},
    "end": {"dateTime": "2026-08-18T20:00:00"},
}
conv_start = datetime(2026, 8, 18, 19, 35, tzinfo=timezone.utc)
conv_end = datetime(2026, 8, 18, 19, 50, tzinfo=timezone.utc)

select_overlapping_calendar_event([floating_event], conv_start, conv_end)

Raises:

TypeError: can't compare offset-naive and offset-aware datetimes
Proposed Fix
  1. In parse_event_times(event) (backend/utils/conversations/calendar_utils.py), attach tzinfo=timezone.utc when parsed start_dt or end_dt has tzinfo is None.
  2. Check start.get('dateTime') is not None / end.get('dateTime') is not None before start.get('date') is not None / end.get('date') is not None, and guard non-dict event inputs.
  3. Add regression tests in backend/tests/unit/test_calendar_linking_overlap_selection.py.

Bounty settlement address (Base Mainnet USDC): 0xb9f3765aeb1974c27a193463f655a1a57b3aec94

Dominant language
Python
Stars
13.8k
Forks
2.6k
Avg merge
5h 14m
Merged PRs (30d)
626

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from BasedHardware/omi

All issues in BasedHardware/omi

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.