Repository navigation
Closed
Description
Problem Description
In plugins/omi-ms365-app/services/, several edge cases and unhandled exceptions cause runtime crashes when Microsoft Graph returns null collections, missing fields, or rate-limiting headers:
-
services/mail.py:read(user_id, message_id)crashes withTypeError: 'NoneType' object is not iterablewhen Microsoft Graph returns{"toRecipients": null}or{"ccRecipients": null}.read()crashes withKeyErrororTypeErrorif recipient items lack the"emailAddress"dict or are non-dict.list_recent()andsearch()crash ifdata.get("value")isNoneor contains non-dict items;_slim_message()crashes withAttributeErroron non-dict input.limitparameter is unbounded.
-
services/teams.py:list_recent_chats()andlist_my_teams()crash withTypeError: 'NoneType' object is not iterablewhen Graph returns{"value": null}.- Unhandled
AttributeErrorif items invalueare non-dict. limitparameter is unbounded.
-
services/sharepoint.py:_slim_item()crashes withTypeError: argument of type 'NoneType' is not iterableon non-dict input due to"folder" in it.list_recent_files()andsearch_files()crash withTypeError: 'NoneType' object is not iterableif Graph returns{"value": null}.
-
services/calendar.py:find_free_slots()crashes withTypeError: 'NoneType' object is not iterablewhen Graph returns{"meetingTimeSuggestions": null}.find_free_slots()crashes withKeyError/TypeErroron unshielded nested keys (s["meetingTimeSlot"]["start"]["dateTime"]) ifmeetingTimeSlotis missing or null._slim_event()crashes on non-dict input.
-
services/graph_client.py:int(resp.headers.get("Retry-After", "2"))crashes withValueError: invalid literal for int() with base 10when Graph returns an HTTP-date inRetry-After(RFC 7231 / RFC 9110) or non-numeric header on 429/503 responses, killing the request instead of retrying.
Proposed Fixes
- Add defensive null and non-dict guards across
services/mail.py(_slim_message,list_recent,search,read), safely parsing recipient addresses. - Add defensive null and non-dict guards across
services/teams.py(list_recent_chats,list_my_teams,create_online_meeting). - Add defensive dictionary guards across
services/sharepoint.py(_slim_item,list_recent_files,search_files,read_file_text). - Add safe nested slot extraction and null guards in
services/calendar.py(_slim_event,find_free_slots). - Add
_parse_retry_afterhelper inservices/graph_client.pysupporting integer seconds and HTTP-date strings. - Author a 100% hermetic unit test suite
plugins/omi-ms365-app/test_services_hardening.pyrunning under pure standard library Python (python3 -S) with zero third-party dependencies.
Proposed bounty: $50.00 USD.
PayPal: [email protected]
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsIn review
Activity
Evos09 commentedon Sep 16, 2026
Submitted PR #14252 with a comprehensive hardening fix covering all services in
plugins/omi-ms365-app/services/:mail.py,teams.py,sharepoint.py, andcalendar.pymax(1, min(limit, 50))) for list/search operationsRetry-Afterheader parsing supporting integer seconds, RFC 7231/9110 HTTP-dates, and invalid fallbacks ingraph_client.pyplugins/omi-ms365-app/test_services_hardening.pyregistered in.github/checks-manifest.yaml(16/16 tests passing under Python stdlib).fix(ms365): register hardening tests in manifest and coerce string li…
fix(ms365): harden services with defensive null guards, recipient ext…