Skip to content

fix: avoid blocking I/O in event loop when reading manifest version#30

Merged
etorhub merged 2 commits into
mainfrom
claude/github-issue-29-yfbxvu
Jun 28, 2026
Merged

fix: avoid blocking I/O in event loop when reading manifest version#30
etorhub merged 2 commits into
mainfrom
claude/github-issue-29-yfbxvu

Conversation

@etorhub

@etorhub etorhub commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Description

frontend.py read manifest.json with a synchronous open() call directly inside _add_resource, an async coroutine that runs on the Home Assistant event loop. Home Assistant's blocking-call detector flags this and can crash/boot-loop on startup.

Fixed by offloading the synchronous read to the executor via hass.async_add_executor_job(_get_version) instead of calling _get_version() directly on the event loop.

Also added __pycache__/ and *.pyc to .gitignore.

Fixes #29

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Other (please describe):

Checklist

  • npm run lint passes
  • npm run typecheck passes
  • npm run test passes
  • npm run format:check passes
  • Commits follow Conventional Commits (e.g. feat:, fix:)

Generated by Claude Code

claude added 2 commits June 28, 2026 07:21
Offload the synchronous manifest.json read to the executor via
hass.async_add_executor_job, since _add_resource runs on the event
loop and synchronous file I/O there blocks the MainThread.

Fixes #29

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@etorhub
etorhub merged commit 25175bd into main Jun 28, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.3.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Home Assistant crash: Blocking I/O call in the event loop (frontend.py)

2 participants