Course Outline card tag-count badge stays stale after editing tags

Open Beginner friendly
#3,308 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@akshaygaur2407 is already working on this.

Since Nov 10, 2026.

  • #3353 by @akshaygaur2407 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript
Domain
frontend

Research direction

Start by comparing the query keys in src/content-tags-drawer/data/apiHooks.ts (the useContentTaxonomyTagsUpdater invalidation) with useContentTagsCount in src/generic/data/apiHooks.ts, which CardHeader uses for the badge. Check that the card's key starts with the same prefix as contentTagsQueryKeys.contentTagsCount(...), then confirm the badge refreshes after saving in the drawer without a page reload. Done means the badge updates on save on the course outline.

Written by the indexing model from the issue text.

Description

After tags are added or removed in the Manage Tags drawer, the tag-count badge on the course outline's section and subsection cards keeps its old value until the page is reloaded. The drawer's own count, and the API (object_tags, object_tag_counts?count_implicit), are correct immediately. BTR testers noted the same in Verawood on TC-00181 / TC-00182 ("changes not at once but after page refresh").

Cause: the drawer's mutation and the card's query use different query keys.

  • useContentTaxonomyTagsUpdater (src/content-tags-drawer/data/apiHooks.ts) invalidates contentTagsQueryKeys.contentTagsCount(pattern), i.e. ['contentTags', 'contentTagsCount', pattern].
  • useContentTagsCount (src/generic/data/apiHooks.ts), which CardHeader uses for the badge, queries ['contentTagsCount', pattern].

React Query matches invalidation keys by prefix, so the card's query is never invalidated. It only refetches on remount or a reload.

Expected: the badge updates when the drawer saves. Building useContentTagsCount's key from contentTagsQueryKeys.contentTagsCount(...) would make the two match.

Environment: main and verawood, code as on master 2026-10-13. Found by the Open edX end-to-end test suite while triaging the BTR sheet's notes.

Dominant language
TypeScript
Stars
18
Forks
228
Avg merge
2d 5h
Merged PRs (30d)
24

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openedx/frontend-app-authoring

All issues in openedx/frontend-app-authoring

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.