Skip to content

Feature/prevent blocking start async #1303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

DevJasperNL
Copy link
Contributor

Proposed change

Made startup behavior non-blocking.
Implemented INetDaemonRuntimeInitializedCheck to be able to wait for NetDaemon runtime inititialization.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • The code compiles without warnings (code quality check)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration are added/changed:

Copy link

codecov bot commented Apr 19, 2025

Codecov Report

Attention: Patch coverage is 81.48148% with 5 lines in your changes missing coverage. Please review.

Project coverage is 82%. Comparing base (91fddd6) to head (3ab4e9d).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs 76% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@         Coverage Diff          @@
##           main   #1303   +/-   ##
====================================
  Coverage    82%     82%           
====================================
  Files       196     196           
  Lines      3841    3850    +9     
  Branches    422     424    +2     
====================================
+ Hits       3176    3184    +8     
- Misses      500     501    +1     
  Partials    165     165           
Flag Coverage Δ
unittests 82% <81%> (+<1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@FrankBakkerNl FrankBakkerNl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, few comments, lets discuss on Discord

Copy link
Collaborator

@helto4real helto4real left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment that we need to discuss further but overall a good implementaiton. Thank you.

@@ -151,12 +164,6 @@ private async Task OnHomeAssistantClientDisconnected(DisconnectReason reason)
logger.LogError(e, "Error disposing applications");
}
IsConnected = false;

if (reason == DisconnectReason.Unauthorized)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was important since we needed the NetDaemon not to retry connection if it was unauthorized. It should just log and think it is connected. It is a hacky way of doing ti when I see it now but that feature is needed not to make user account locked etc. Unless you handle this somewhere else in the code and I fail to see it.

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.

3 participants