Skip to content

Conversation

@helto4real
Copy link
Collaborator

@helto4real helto4real commented Jul 22, 2022

Breaking change

Changes behaviour of SubscribeAsync and SubscribeAsyncConcurrent to safely recover from unhandled exception. This was the intended behaviour from the beginning so technically it is a bugfix.

Proposed change

This PR adds a safe subscription. Safe means it will recover from unhandled exceptions and continue process messages. Normal Subscribe would unsubscribe all subscribers when unhandled exceptions occurs.

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

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the [development checklist][dev-checklist]
  • The code compiles without warnings (code quality chek)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2022

Codecov Report

Merging #733 (672e422) into dev (d7ec1c5) will decrease coverage by 0.65%.
The diff coverage is 37.93%.

@@            Coverage Diff             @@
##              dev     #733      +/-   ##
==========================================
- Coverage   78.32%   77.67%   -0.66%     
==========================================
  Files         139      139              
  Lines        3576     3624      +48     
  Branches      363      367       +4     
==========================================
+ Hits         2801     2815      +14     
- Misses        630      663      +33     
- Partials      145      146       +1     
Flag Coverage Δ
unittests 77.67% <37.93%> (-0.66%) ⬇️

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

Impacted Files Coverage Δ
...sModel/NetDeamon.HassModel/ObservableExtensions.cs 48.19% <37.93%> (-17.53%) ⬇️
...mon.HassClient/Internal/Net/WebSocketClientImpl.cs 61.11% <0.00%> (-8.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d7ec1c5...672e422. Read the comment docs.

@helto4real
Copy link
Collaborator Author

Merging this due to low activity on reviews

@helto4real helto4real merged commit 44b5e00 into dev Aug 8, 2022
@helto4real helto4real deleted the SubscribeSafe branch August 8, 2022 07:58
Ikcelaks pushed a commit to Ikcelaks/netdaemon that referenced this pull request Dec 23, 2022
* SubscribeSafe added.

* Added ILogger overload

* Fixed check if logger exists before creating factory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants