# Release History

## 0.0.35-beta-30.1
### Added
- Patch to log custom event logging under `CustomProperties` and exception under `ExceptionDetails` of the log message.

## 0.0.35-beta-30
### Added
- Fixed bug where `IMessagePollingHandle` instance is globally shared across different Web chat Adapter instances.

## 0.0.35-beta-29
### Added
- Added `IMessagePollingHandle` to provide more control over polling calls from the Adapter consumer. Please refer to the Readme document.
- Update dependencies for vulnerabilities.

## 0.0.35-beta-28
### Added
- Messages are cached while WebChat is still getting connected and sent to WebChat after connection is established.
- Polling will not happen if a thread has been deleted in the background or current user has lost permission to the chat.
- Number of polling calls have been minimized by not allowing any new calls if last polling call happened 15 sec ago.

## 0.0.35-beta-27
### Added
- Added more telemetry around service calls.
- Increment version of Chat SDK which enables separate Trouter urls for EUDB regions. 

## 0.0.35-beta-26
### Added
- Fixed a bug in attachment download caused due to CustomEvent changes. 

## 0.0.35-beta-25
### Added
- Upgraded to node 18 and npm 9.5.
- Removed partial event support for IE11.

## 0.0.35-beta-24
### Added
- WebChat init timeout in Adapter options was not used.
- Additional logging for attachment downloads.

## 0.0.35-beta-23
### Added
- Security update

## 0.0.35-beta-22
### Added
- Cherry pick changes of 0.0.35-beta-18.1 to master.

## 0.0.35-beta-21
### Added
- ErrorEventNotifier send message failed error add sendMessageOptions.

## 0.0.35-beta-20
### Added
- Polling interval for initial 30 secs will be 5 secs.
- ErrorEventNotifier callback added to send error messages back to the caller.

## 0.0.35-beta-19
### Added
- Upgrade Chat client to 1.3.1
- Upgrade signaling client to 1.0.0-beta.16

## 0.0.35-beta-18.1
### Added
- Patch for attachment download to not use window event die to which attachment gets downloaded on multiple threads.

## 0.0.35-beta-18
### Added
- Download attachments in the background while other text messages are unblocked.
- Flag `shouldFileAttachmentDownloadTimeout` option in the `AdapterOptions` to enable timeout.
- If the previous flag is set to true then set the value `fileAttachmentDownloadTimeout` in milliseconds in `AdapterOptions`. If the previous flag is set and no value is set for this option, then default timeout will be 90 sec.

## 0.0.35-beta-17
### Added
- Avoid sending duplicate messages either arrived first through polling or real time notification new/edited message. This will prevent messages from being re-rendered.

## 0.0.35-beta-16
### Added
- Use messageId as webchat:sequence-id instead of sequenceId as messageId is available in both polling and websocket messages.
- Add x-ms-usergent request header to Adapter originated requests so we are aware of which Adapter version is currently in use.
- Upgraded vulnerable libraries.

## 0.0.35-beta-15
### Added
- Stop polling when faced with client errors 401, 403, 404

## 0.0.35-beta-14
### Added
- Updated botframework-webchat from "4.14.0" to "4.15.4"

## 0.0.35-beta-13
### Added
- Upgraded the Chat SDK version to 1.3.0 which provides enhanced realtime notification capabilities. If the realtime notification is disconnected, it tries to reconnect to the same endpoint as previous connection state adding resiliency. If any messages are present in queue that went undelivered because of disconnection then it can recover those messages for upto 15 minutes and send notifications when real time notification connects again.
- Upgraded @azure/communication-signaling from "1.0.0-beta.13" to "1.0.0-beta.15"

## 0.0.35-beta-12
### Added
- Added new method `createBotAttachment` to `IFileManager` so Adapter users can implement it own way.
- Global level `SDKInit.SDK.chatClient` and `SDKInit.SDK.chatThreadClient` made as function return values as they were having
  synchronization issues when second thread is created quickly `SDKInit.SDK.chatThreadClient` gets overridden and fetches messages of that thread even when the corresponding Adapter instance is not used.
- Added a new event acschat-online to EventManager which will be triggered when Acs Chat reconnection is triggered.
- Updated Jest testing framework to lastest version 29.0.0

## 0.0.35-beta-11
### Added
- Added `serverPageSizeLimit` to specify the number of messages to fetch from the server at once.
- Polling will continue even if there is an exception in `listMessages` call.
- Polling will be re-initialized if real time notification connect or disconnect events came. If it had stopped for some reason
  it will start and if was going on, then will just re-initialize.

## 0.0.35-beta-10
### Added
- Enable the option to handle message parsing errors via error activity.
- Fix the logs for converting events to activities.

## 0.0.35-beta-9

### Added

- Resume polling when online event notification comes.
- Check for WebChat connection status observer before setting it to connected.
- Set disconnectTime in state to undefined, so that the call to listMessages is issued just once even with multiple online events.

## 0.0.35-beta-8

### Added

- Updated README.md for the previous changes

## 0.0.35-beta-7

### Added

- Re-introduced polling for messages if real time notifications stop working
- Remove send message retry as retries are configured in ChatClient

## 0.0.35-beta.6

### Added
- Updated @azure/communication-chat from "1.1.2" to "1.2.0"
- Updated @azure/communication-common from "1.0.0" to "2.0.0"
- Updated @azure/communication-signaling from "1.0.0-beta.11" to "1.0.0-beta.13"
- Replaced @azure/communication-administration with @azure/communication-identity

## 0.0.35-beta.5

### Added
- Added attachmentLayout as part of AcsMessageFormat

## 0.0.35-beta.4

### Added
- Added the clientActivityId to the message sending logs

#### Removed
- Removed polling from adapter

## 0.0.35-beta.3

### Added
- Added 'webchat:sequence-id' as a channel metadata to expose sequence id

#### Key Bug Fixes
- Fixed the bug where metadata is overridden by adaptivecard metadata when value field is present

## 0.0.35-beta.2

### Added
- Added message id as id for edited message
- Added client message id to metadata if present

## 0.0.35-beta.1

### Added
- Add the `fromList` tag in message channel data for the messages from polling.

## 0.0.34

#### Added
- Add the support to pass the DisplayName in sending typing indicator.

## 0.0.32

#### Added
- Add the support to pass the ChatClient into adapter constructor.

#### Key Bug Fixes
- Change the order of middlewares application so that custom middlewares are called before inbuilt ones
- Move createIngressEnhancer in front of createEgressEnhancer so that egress can be called from ingress middlewares properly
- Fix conversation.id to be the threadId from getState for logging

## 0.0.31

#### Key Bug Fixes
- Move the application of custom middlewares to inside create Enhancer

#### Added
- Added more logging events in the adapter
- Populate activity.attachments from amsReferences and amsMetaData

#### Removed
- Removed unused dependencies

## 0.0.30

#### Key Bug Fixes
- Optimize polling to add a default interval of 3s & utilize startTime for fetching new messages only
- Split webpack configs so debug isn't overwriting prod bundle for release pipeline

#### Breaking Changes
- Change type of activity.channelData.tags to string

## 0.0.29

#### Breaking Changes
- Updated the converter to support new payload type for suggested actions/cards
- Changed BOT_ADAPTIVE_CARD_METADATA_VALUE to 'azurebotservice.adaptivecard'
- Added validation to the tags to make sure it in the format of array, otherwise set to null
- Add support for chatThreadDeleted event

## 0.0.28
#### Key Bug Fixes
- Minify the production bundles

## 0.0.27

#### Key Bug Fixes
- Filter incoming chat events to current conversation only
- Fix conversation.id in the activity to be the threadId
- Add thumbnailUrl for audio files to play them inline

#### Breaking Changes
- For Message Edit activities, activity.type is changed to "message"
- Removed `adaptiveCards` property on activities, adaptive cards are sent in attachmentsData
- When adaptive cards are enabled we do not support sending text content in addition to the adaptive card. It is currently one or the other. Enabling adaptive cards expects the card payload to be sent as the message content without additional text. The card payload(s) are then set inside `activity.attachmentsData` for Webchat to render. See Adaptive Cards section in README.

#### Added
- Add sender display name to Typing activities
- Support rendering adaptive cards sent by bots
- Support user defined middlewares via `ingressMiddleware` and `egressMiddleware` options inside `AdapterOptions`

## 0.0.26

#### Key Bug Fixes
- Fix missing thread update when agent ends conversation:
  - Remove polling for participants and listen for ParticipantsAdded/Participants removed events instead, send thread update activity when these events are received

## 0.0.25

#### Added
- Add MessageEdit Activity which is dispatched when ChatMessageEditedEvents are received
- Added `IUploadedFile` which contains file id and metadata for an uploaded file
- Added `FileMetadata` type for file metadata
- Added `IAttachment` to type the attachments objects received from Webchat
- Added `IFileUploadRequest` which extends `IAttachment`

#### Breaking Changes
- IFileManager `uploadFile` changed to `uploadFiles(files: IFileUploadRequest[]): Promise<IUploadedFile[]>`
- IFileManager `downloadFile` changed to `downloadFiles(files: IUploadedFile[]): Promise<File[]>`
- IFileManager implements `getFileMetadata(metadata?: Record<string, string>): FileMetadata[] | undefined` and `createFileMetadataProperty(metadata: FileMetadata[]): Record<string, string>`

#### Key Bug Fixes
- Added polling for messages as fallback when realtime notifications are not enabled, this fixes "missing" messages due to timing issues

## 0.0.24

#### Added
- Added thumbnail url for video attachments & remove usage of blob URLs which Webchat patches from the activity
- Remove console message to add Webchat script tag

## 0.0.23

#### Added
- Add optional metadata to IFileMetadata, this is to support additional data that may be required when downloading files.
- Publish debug build

## 0.0.22

#### Added
- Added support for passing through additional metadata when sending messages
- Publishing es-modules and types

#### Breaking Changes
- Remove internal nesting of metadata under `acsChatMetada` property
- `IFileManager.getChatMessageMetadata()` return type is updated to `Record<string, string>` to enforce that metadata should be stringified

## 0.0.21

#### Added
- Demo OneDriveFileManager implemetation of `IFileManager`

#### Breaking Changes
- Added support for filesharing, `IFileManager` is now one of the required parameters when calling `createACSAdapter()`