Skip to content

CHI-3707: Identify current user in conversation with separate check for masking purposes#3872

Merged
stephenhand merged 5 commits intomasterfrom
CHI-3707-mask_participants_missing_from_redux
Feb 6, 2026
Merged

CHI-3707: Identify current user in conversation with separate check for masking purposes#3872
stephenhand merged 5 commits intomasterfrom
CHI-3707-mask_participants_missing_from_redux

Conversation

@stephenhand
Copy link
Collaborator

Description

Now we are more cautious about identifying a particiapant as an agent for masking purposes, we need a specific check for the current agent.

Checklist

  • Corresponding issue has been opened
  • New tests added
  • Feature flags added
  • Strings are localized
  • Tested for chat contacts
  • Tested for call contacts

Other Related Issues

None

Verification steps

AFTER YOU MERGE

  1. Cut a release tag using the Github workflow. Wait for it to complete and notify in the #aselo-deploys Slack channel.
  2. Comment on the ticket with the release tag version AND any additional instructions required to configure an environment to test the changes.
  3. Only then move the ticket into the QA column in JIRA

You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P

@stephenhand stephenhand requested a review from gpaoloni February 6, 2026 11:15
@stephenhand
Copy link
Collaborator Author

@copilot - extend the unit test coverage for this redux subscribe function to cover the new check

It should test that if the identity of the participant matches the identity of the user from the Flex manager, it should be identified as an agent, irrespective of other checks

Copy link
Contributor

Copilot AI commented Feb 6, 2026

@stephenhand I've opened a new pull request, #3873, to work on those changes. Once the pull request is ready, I'll request review from you.

@stephenhand
Copy link
Collaborator Author

@copilot - extend the unit test coverage for this redux subscribe function to cover the new check

It should test that if the identity of the participant matches the identity of the user from the Flex manager, it should be identified as an agent, irrespective of other checks

Run eslint for plugin-hrm-form and fix any issues raised in addition to any other checks prior to requesting reviews for any changes

Copy link
Contributor

Copilot AI commented Feb 6, 2026

@stephenhand I've opened a new pull request, #3876, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits February 6, 2026 13:48
Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
CHI-3707: Add test coverage for current user identity check in masking logic
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an explicit check to identify the current user (agent) in conversation participants for masking purposes. The change addresses a need for more specific identification of the current agent, adding a priority check that compares participant identities with the logged-in user's identity before falling back to other agent identification methods.

Changes:

  • Added a first-priority identity comparison check to identify the current user as an agent
  • Enhanced test suite with three new test cases covering scenarios where participant identity matches the manager user identity
  • Ensured the current user is never masked regardless of other attributes like member_type

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
plugin-hrm-form/src/maskIdentifiers/index.ts Added identity comparison as the first condition in agent identification logic, checking if participant identity matches manager user identity
plugin-hrm-form/src/_tests/maskIdentifiers/index.test.ts Added test cases and updated test helper to support identity parameter, covering scenarios where current user identity matching takes precedence

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 84 to +105
each([
{
testCase: 'identity matches manager user identity, regardless of other checks',
participantAttributes: {},
participantIdentity: 'current-user-identity',
flexParticipants: {},
expectedName: 'Original Name',
},
{
testCase: 'identity matches manager user identity, even with guest member_type',
participantAttributes: { member_type: 'guest' },
participantIdentity: 'current-user-identity',
flexParticipants: {},
expectedName: 'Original Name',
},
{
testCase: 'identity matches manager user identity, even when not in flex store',
participantAttributes: {},
participantIdentity: 'current-user-identity',
flexParticipants: { participant1: { type: 'customer', sid: 'MB999' } },
expectedName: 'Original Name',
},
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a test case where manager.user.identity is undefined or null to ensure the new identity check handles this edge case correctly. This would verify that participants aren't incorrectly identified as agents when both identities are missing.

Copilot uses AI. Check for mistakes.
@stephenhand stephenhand merged commit b64898d into master Feb 6, 2026
32 checks passed
@stephenhand stephenhand deleted the CHI-3707-mask_participants_missing_from_redux branch February 6, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants