Skip to content
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

Make Add WiFi more reliable #250

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

Conversation

zytegalaxy
Copy link
Collaborator

This PR attempts to address #247

  1. It adds better exception handling during wifi service initialization
  2. retries a few times if add_wifi_connection fails with sdbus_async.networkmanager.exceptions.NetworkManagerUnknownConnectionError exception.

Copy link

codecov bot commented Mar 3, 2025

Codecov Report

Attention: Patch coverage is 46.66667% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ubo_app/services/030-wifi/wifi_manager.py 41.66% 14 Missing ⚠️
...vices/030-wifi/pages/create_wireless_connection.py 66.66% 2 Missing ⚠️
Flag Coverage Δ
ubuntu-latest 56.87% <46.66%> (-0.06%) ⬇️

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

Files with missing lines Coverage Δ
ubo_app/system/hotspot_config.py 0.00% <ø> (ø)
...vices/030-wifi/pages/create_wireless_connection.py 40.25% <66.66%> (+2.75%) ⬆️
ubo_app/services/030-wifi/wifi_manager.py 47.59% <41.66%> (-2.74%) ⬇️

Copy link
Collaborator

@sassanh sassanh left a comment

Choose a reason for hiding this comment

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

It looks very good. Three suggestions:

  1. It makes the code base crowded to have a _with_retry version of some functions, so we need to either make the original function always retry (remove _with_retry and move the decorator to the original function) or retry when calling the function, using the tenacity.Retrying function like this I think the latter is the best way to go as it is more explicit and less opinionated.
  2. Lint commits and some other commits don’t have value by themselves, I suggest squashing all commits of this pull request into a single refactor(wifi): improve resilience of wifi service by retrying week points if they fail or something like that. It helps keeping our git log stay clean. You can do it by soft resetting to the parent commit of this branch, and then do a single commit and force-pushing it.
  3. Add the commit message to the Upcoming section of the change log.

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.

2 participants