ADORSYS-GIS / ADORSYS-GIS/CoopData
Role Labels from Configure Roles Not Propagated Across Dashboards ## User Story
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 0
- Avg merge
- 20h 22m
- Merged PRs (30d)
- 48
Description
# Role Labels from Configure Roles Not Propagated Across Dashboards
## User Story
**As a** Federation, Apex, or Cooperative user,
**I want** to see the role and level names configured by the Ministry,
**so that** the terminology displayed across the application matches the official naming.
## Description
When the Ministry updates role or level names through **Configure Roles** (`/app/configure-roles`), the updated labels are only reflected in the Ministry dashboard.
Federation, Apex, and Cooperative users may continue seeing the previous name, sometimes exactly one save behind, or fall back to hardcoded default labels.
## Expected Behavior
When the Ministry renames a role or level:
* The updated label should propagate to all applicable user levels.
* The new name should be reflected across all dashboards.
* The updated label should appear in:
* Sidebar role badges
* Dashboard headings
* Role and level labels
* Other UI components consuming role labels
* Changes should become available across users within a short propagation window.
* All users should receive the latest valid label rather than a stale cached value.
## Root Cause
The issue was caused by several inconsistencies in label retrieval and caching:
* The sidebar role badge used static i18n labels instead of the centralized labels context.
* The offline seeder only pre-cached labels for the Ministry role.
* An offline-mode flag triggered by a Keycloak connectivity issue while online caused IndexedDB snapshots to be served without attempting a network request.
* The persisted query-cache buster was resolved before authentication initialization, causing users to share an `anon_none` cache snapshot.
* Backend Redis caching allowed concurrent `GET` requests to re-cache stale labels after cache invalidation.
## Resolution
* Updated the sidebar to use the labels-aware `t()` function.
* Updated offline seeding to include labels for all roles.
* Implemented network-first label fetching when the application is online.
* Added a per-user cache buster to prevent users from sharing stale snapshots.
* Implemented backend write-through caching with delayed double-delete invalidation.
* Configured the labels query with a **30-second stale time**.
## Acceptance Criteria
* [ ] Ministry-configured role and level names are displayed consistently across all dashboards.
* [ ] Sidebar role badges use the configured labels.
* [ ] Dashboard headings and other label usages reflect configured names.
* [ ] Labels are correctly cached per user.
* [ ] Offline snapshots contain labels for all applicable roles.
* [ ] Online users attempt to retrieve the latest labels from the network.
* [ ] Redis invalidation does not allow stale labels to overwrite the latest values.
* [ ] Updated labels propagate within the expected cache window.
* [ ] Existing role-label functionality remains backward compatible.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing linked pull request #159 against the acceptance criteria and the stated resolution. Verify that configured labels reach sidebar badges, headings, dashboards, offline snapshots, and per-user caches, and that online fetching and Redis invalidation do not serve stale values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- redis, typescript
- Domain
- backend-api-design, full-stack
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100