You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implicit tag count merges same-named tags from different taxonomies #955
get_object_tag_counts(..., count_implicit=True) in src/openedx_tagging/api.py undercounts when an object has tags from two taxonomies whose lineages are the same text.
The implicit count collects each tag's lineage prefixes into one set per object. A lineage is only the tag values joined by tabs, with no taxonomy in it, so "Shared" in taxonomy A and "Shared" in taxonomy B become one set entry.
To reproduce: create two taxonomies, add a root tag named Shared to each, and tag obj1 with both. get_object_tag_counts("obj1") returns 2, and get_object_tag_counts("obj1", count_implicit=True) returns 1. The implicit count should never be lower than the explicit one. Confirmed on main on 2026-11-20.
Likely fix: keep taxonomy_id in the selected rows and key the set by (taxonomy_id, prefix), plus a regression test for the case above.
Found by CodeRabbit during review of #940. The code predates that PR.
Activity