fix: update assignee query to handle empty names and improve description - #8
Merged
Merged
Conversation
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.
Problem
The "Open tasks by assignee" dashboard preset showed raw
project_membersUUIDs as chart labels instead of member names.Fixes Paca-AI/paca#471
Root cause
The preset's SQL selected
pm.id::textas the display label instead of resolving it to a name:Fix
Resolve a real display name through both
project_memberspaths:users.full_name, falling back tousers.usernamewhenfull_nameis blank (it'sNOT NULL DEFAULT '', not nullable, so a plainCOALESCEwouldn't have caught this — usedNULLIF(full_name, '')).agents.name."Unassigned".Also dropped "(member id shown; ...)" from the preset description since it no longer applies.
Testing
Verified against the real schema rather than just by inspection: applied all
services/apicore migrations plus this plugin's own migrations to an isolated throwaway Postgres container, seeded fixture rows for a human member with a full name, a human member with a blank full name, an agent member, and an unassigned task, then ran the old vs. new query.project_membersUUIDs (reproduces the bug).Jane Doe,noname(username fallback),Review Bot(agent name),Unassigned— done tasks correctly excluded from counts.tsc --noEmitpasses; no other file in the repo references this preset's query text.Note: this fixes the preset template for panels created going forward. It does not retroactively update dashboard panels that already saved the old query text (e.g. the reporter's existing panel) — those need the preset re-applied or the panel query edited by hand.