Skip to content

fix: MVR cascade exclusion crashes with AttributeError when last referenced SVC is excluded - #236

Merged
jimisola merged 2 commits into
mainfrom
fix/delete-mvr-attributeerror-235
Mar 1, 2026
Merged

fix: MVR cascade exclusion crashes with AttributeError when last referenced SVC is excluded#236
jimisola merged 2 commits into
mainfrom
fix/delete-mvr-attributeerror-235

Conversation

@jimisola

Copy link
Copy Markdown
Member

Summary

  • Fixes a runtime crash in __delete_mvr where a spurious nested loop iterated over List[UrnId] and called .remove() on each UrnId element, which has no such method
  • Adds 5 tests covering MVR cascade exclusion behaviour using a dedicated minimal fixture

Fixes #235, refs #222.

Test plan

  • test_mvr_excluded_when_sole_referenced_svc_is_excluded — MVR with only one excluded SVC is cascade-excluded
  • test_mvr_included_when_at_least_one_referenced_svc_is_included — MVR with a mix survives
  • test_excluded_svc_removed_from_included_mvr_svc_ids — surviving MVR's svc_ids cleaned up correctly
  • test_excluded_svc_not_present_after_filtering — excluded SVC gone from svcs
  • test_included_svc_present_after_filtering — included SVC still in svcs
  • All 99 unit tests pass

…renced SVC is excluded

__delete_mvr iterated over _mvrs_from_svc[svc_urn_id] with a nested
loop, treating each UrnId element as a list and calling .remove() on it.
UrnId has no .remove(), causing an AttributeError at runtime whenever
SVC filtering cascade-excluded an MVR.

Fix by removing the spurious inner loop and calling .remove() directly
on the list.

Adds tests covering: MVR cascade-excluded when its sole SVC is excluded,
MVR retained when at least one referenced SVC is included, and correct
cleanup of excluded SVC from surviving MVR svc_ids.

Fixes #235, refs #222.
@jimisola jimisola self-assigned this Mar 1, 2026
@jimisola
jimisola merged commit a5491d3 into main Mar 1, 2026
9 checks passed
@jimisola
jimisola deleted the fix/delete-mvr-attributeerror-235 branch March 1, 2026 14:22
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.

bug: deleting an MVR crashes with AttributeError when SVC filter removes its last referenced SVC

1 participant