Skip to content

fix(parser): tolerate malformed match timestamps - #10

Merged
aktech merged 2 commits into
aktech:mainfrom
DevarshP610:fix/robust-match-date-parsing
Nov 5, 2026
Merged

aktech merged 2 commits into
aktech:mainfrom
DevarshP610:fix/robust-match-date-parsing

Conversation

@DevarshP610

Copy link
Copy Markdown
Contributor

What changed

  • Make match timestamp parsing tolerant of malformed upstream startDate values.
  • Preserve valid numeric timestamps, including numeric strings.
  • Treat an invalid timestamp as missing date metadata instead of aborting the entire score refresh.
  • Add regression tests for valid numeric timestamps and malformed values.

Reproduction

A malformed upstream match such as this used to crash _parse_match:

{"startDate": "not-a-timestamp"}

It raised:

TypeError: unsupported operand type(s) for /: 'str' and 'int'

The match now remains available with an empty date, while network and HTTP errors continue to be reported by the existing CLI/TUI error handling.

Verification

  • python -m pytest tests.py -q - 11 passed
  • python -m compileall -q criclive tests.py
  • git diff --check

The repository has no CONTRIBUTING.md; its README directs contributions through GitHub issues and pull requests.

Fixes #1

DevarshP610 and others added 2 commits October 20, 2026 16:50
Keep a malformed upstream startDate from aborting the entire score refresh, while preserving valid numeric timestamps and covering the behavior with tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Catch OSError for out-of-range timestamps, treat 0 and booleans as missing dates, and skip a single malformed match instead of dropping every match.
@aktech
aktech merged commit 0f52b71 into aktech:main Nov 5, 2026
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.

Add Exception/Error handling

2 participants