Repository navigation
Stop deactivating blackbox device links during UISP import - #1150
Merged
Merged
Conversation
Don't mark links inactive for "missing from UISP" when either end is a blackBox device (manually added non-ubiquiti device), since UISP can't actually detect those links and they only exist there if created by hand.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1150 +/- ##
==========================================
+ Coverage 95.02% 95.16% +0.13%
==========================================
Files 100 100
Lines 4605 4612 +7
==========================================
+ Hits 4376 4389 +13
+ Misses 229 223 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
lotia
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Don't mark blackBox links inactive just because they're missing from UISP
Problem
At the end of each import,
import_and_sync_uisp_linksmarks every Active link whoseuisp_idis no longer in UISP as Inactive, immediately and with no grace period.UISP can't detect links that touch
blackBoxdevices, such as MikroTik routers. Those links exist in UISP because someone created them by hand. In a recent UISP snapshot, all 465 links touching a blackBox device hadorigin: manual. If a hand-drawn link is deleted or lost in UISP, the MeshDB link is marked Inactive even when it's still up. When a volunteer sets it back to Active, the next hourly import reverts it again.Example: the NN2481↔NN1447 60 GHz link kept going back to Inactive while it was carrying traffic. It only stayed fixed after its
uisp_idwas cleared by hand.Change
UISP_DEVICE_TYPES_WITHOUT_LINK_DETECTION = ["blackBox"]inuisp_import/constants.py.import_and_sync_uisp_linkstakes an optionaluisp_deviceslist. When it's given, links where either end is a blackBox device are skipped when sweeping for links that are missing from UISP. A skip is logged; nothing else changes.run_update_from_uispandrun_uisp_on_demand_importfetch the UISP device list once and pass it to both the device and the link import, so there are no extra UISP API calls.Unchanged
uisp_devicesbehave exactly as before.FYI
Manually created links between non-blackBox devices (about 120 in UISP) are still marked Inactive if they disappear, because once a link is gone we can't tell if it was manually created. A follow-up PR adding a grace period for links missing from UISP will cover these.