diff --git a/sdk/communication/communication-chat/CHANGELOG.md b/sdk/communication/communication-chat/CHANGELOG.md index 637b7044c465..6bc6742f32cb 100644 --- a/sdk/communication/communication-chat/CHANGELOG.md +++ b/sdk/communication/communication-chat/CHANGELOG.md @@ -1,8 +1,15 @@ # Release History +## 1.1.2 (Unreleased) + +### Breaking Changes + +- Prohibit sending the typing notification request within 8 seconds of the previous request. + ## 1.1.1 (2021-10-19) ### Features Added + - Updated to @azure/communication-signaling@1.0.0-beta.11. - Added `signalingClientOptions` in `ClientOptions`. diff --git a/sdk/communication/communication-chat/package.json b/sdk/communication/communication-chat/package.json index 88b76495e0a0..6478358b1428 100644 --- a/sdk/communication/communication-chat/package.json +++ b/sdk/communication/communication-chat/package.json @@ -1,6 +1,6 @@ { "name": "@azure/communication-chat", - "version": "1.1.1", + "version": "1.1.2", "description": "Azure client library for Azure Communication Chat services", "sdk-type": "client", "main": "dist/index.js", diff --git a/sdk/communication/communication-chat/src/chatThreadClient.ts b/sdk/communication/communication-chat/src/chatThreadClient.ts index d5715a872814..8641a711ed87 100644 --- a/sdk/communication/communication-chat/src/chatThreadClient.ts +++ b/sdk/communication/communication-chat/src/chatThreadClient.ts @@ -465,13 +465,14 @@ export class ChatThreadClient { try { const dateNow = new Date(); const { senderDisplayName, ...restOptions } = updatedOptions; + if (this.canPostTypingNotification(dateNow)) { + this.timeOfLastTypingRequest = dateNow; + await this.client.chatThread.sendTypingNotification(this.threadId, { sendTypingNotificationRequest: { senderDisplayName: senderDisplayName }, ...restOptions }); - - this.timeOfLastTypingRequest = dateNow; return true; }