-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Description
Ticket: Enforce Consistent Naming and Remove Secretariat Masking in Conversations
Description
Currently, when a Secretariat user posts a message, their name is hardcoded to "Secretariat" in some flows (e.g., processConversationHistory), masking their actual identity. In other flows, it manually concatenates first and last names.
We need to:
- Always display the user's actual name, even for Secretariat users.
- Standardize how the name is formatted (e.g., "First Last") across the entire application to prevent inconsistencies.
Acceptance Criteria / TODOs
Backend Changes
-
Create Naming Utility:
- Create a utility function (e.g.,
getUserFullName(user)) in src/utils/utils.js (or similar) that handles safe concatenation ofuser.name.firstanduser.name.last. - Handle edge cases (missing first or last name).
- Create a utility function (e.g.,
-
Refactor
ConversationRepository.js:- Update processConversationHistory:
- Remove the ternary operator that force-sets
author_nameto 'Secretariat' if isSecretariat is true. - Use the new utility function to set
author_namefor all users. - Ensure
author_rolestill correctly reflects 'Secretariat' vs 'Partner'.
- Remove the ternary operator that force-sets
- Update processConversationHistory:
-
Refactor
ConversationController.js:- Update createConversationForTargetUUID:
- Replace the manual
[user.name.first, user.name.last].join(' ')with the new utility function.
- Replace the manual
- Update createConversationForTargetUUID:
Testing
- Unit Tests:
- Verify that a message created by a Secretariat user now has their actual name in
author_name(e.g., "Jane Doe") whileauthor_roleremains "Secretariat". - Verify that the name formatting is consistent across different creation paths (
createConversationForTargetUUIDandprocessConversationHistory).
- Verify that a message created by a Secretariat user now has their actual name in
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
In Review