Fix: User Management email column closure bug#9485
Fix: User Management email column closure bug#9485mktwix wants to merge 1 commit intopgadmin-org:masterfrom
Conversation
The email column in User Management was using accessorKey which gets converted to accessorFn in PgTable.jsx. This caused a closure bug where all columns captured the same accessorKey value, resulting in all users displaying the logged-in user's email address. Fix by explicitly using accessorFn to avoid the closure issue.
WalkthroughThe Email column accessor in the Users component was modified to retrieve values via a function instead of a direct property reference, with null-safety handling to ensure empty strings are returned when email is absent. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @mktwix, can you please provide a screenshot of the mentioned bug in this PR? |
|
@mktwix In addition to what Khushboo asked, if the issue is closure in PgTable then I think PgTable should be fixed. |
|
@khushboovashi @adityatoshniwal |

The email column in User Management was using accessorKey which gets converted to accessorFn in PgTable.jsx. This caused a closure bug where all columns captured the same accessorKey value, resulting in all users displaying the logged-in user's email address.
Fix by explicitly using accessorFn to avoid the closure issue.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.