Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[communication-chat] Data Loss Prevention and TextOnlyChat #29700

Draft
wants to merge 8 commits into
base: communication-chat/1.6.0-beta.2
Choose a base branch
from

Conversation

jimchou-dev
Copy link
Member

Packages impacted by this PR

  • communication-chat

Issues associated with this PR

Describe the problem that is addressed by this PR

  • Implementing Data Loss Prevention and TextOnlyChat to support TeamsInterop feature
  • [pending] Still need to update Signaling version and test recording

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

Are there test cases added in this PR? (If not, why?)

  • Unit test added
  • No live test because these are TeamsInterops feature

Provide a list of related PRs (if any)

Command used to generate this PR:**(Applicable only to SDK release request PRs)

Checklists

  • Added impacted package name to the issue description
  • Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
  • Added a changelog (if necessary)

senderCommunicationIdentifier: mockCommunicationIdentifier,
deletedOn: new Date("2020-06-26T18:06:06Z"),
metadata: { tags: "tag" },
policyViolation: { state: "contentBlocked"}
Copy link
Member

Choose a reason for hiding this comment

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

Should also have a mock for warning as well

Copy link
Member

Choose a reason for hiding this comment

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

Also a test for without policyViolation

const { state } = policyVolation;
const result: PolicyViolation = {
result: state
};
Copy link
Member

Choose a reason for hiding this comment

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

This is pretty confused in reading after the renaming

Copy link
Member

Choose a reason for hiding this comment

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

Other developer would be confused about the difference between state and result here.

@@ -157,3 +161,17 @@ export interface UploadChatImageResult {

/** Type of Supported Attachments. */
export type ChatAttachmentType = "image" | "file" | "unknown";

/** State of Policy Violation message. */
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/** State of Policy Violation message. */
/** Result of Policy Violation message. */


/** Policy violation of a message (if applicable). */
export interface PolicyViolation {
/** State of Policy Violation message. */
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/** State of Policy Violation message. */
/** Result of Policy Violation message. */

@@ -67,3 +67,13 @@ directive:
transform: >
$["x-ms-enum"].modelAsString = false;
```

### Set PolicyViolationMessageState Model as string false
Copy link
Member

Choose a reason for hiding this comment

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

Why when we do the renaming, the rename is not applied to Chat gateway? Chat Gateway keep using state but only the client side using result? Is this what we want?

expectedIdentifier.communicationUser?.id,
);
assert.deepEqual(responseMessagingPolicy, expectedMessagingPolicy);
assert.isTrue(responseMessagingPolicy?.textOnlyChat);
Copy link
Member

Choose a reason for hiding this comment

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

Is this textOnlyChat nullable? Could we test that scenario?

const {
senderCommunicationIdentifier: expectedIdentifier,
content: expectedContent,
policyViolation: expectedPolicyViolation,
Copy link
Member

Choose a reason for hiding this comment

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

Where is the expectedPolicyViolation being defined?

senderCommunicationIdentifier: mockCommunicationIdentifier,
deletedOn: new Date("2020-06-26T18:06:06Z"),
metadata: { tags: "tag" },
policyViolation: { state: "contentBlocked"}
Copy link
Member

Choose a reason for hiding this comment

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

Also a test for without policyViolation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants