Changelog: Twilio IP Messaging JavaScript SDK
Danger
Programmable Chat has been deprecated and is no longer supported. Instead, we'll be focusing on the next generation of chat: Twilio Conversations. Find out more about the EOL process here.
If you're starting a new project, please visit the Conversations Docs to begin. If you've already built on Programmable Chat, please visit our Migration Guide to learn about how to switch.
We recommend using these links in your projects. As we patch bugs, these links will automatically be updated with the fixes.
Links are provided to specific patch versions here. We don't recommend using these links unless you have a specific need for a certain patch of a release.
- Fixed an issue where the JS SDK client threw an error when updates were performed on the user immediately after the client sdk instance initialization completed
- Fixed a bug whereby a users could not see new messages in channel after leaving and rejoining
- Fixed a possible loss of "channel left" and "channel removed" events
- Fixed issues when setting consumption horizon to
0
on a channel
- Adds:
setNoMessagesConsumed
method to reset consumption horizon to the default state of no messages consumed
- Fixed an issue where Message pagination did not work correctly in some cases
- Fixed an issue where the promise was not rejected when a command failed due to a transport issue
- Fixed an issue with the Access Token update logic which caused a websocket reconnection loop in some cases
- Adds Reachability Indicator functionality and properties
- Adds
Attributes
property to Message object - Adds the Connection state object for the local client instance
- Fixed a bug whereby
AccessManager.updateToken(token)
did not work for the JS IP Messaging SDK client
- Add paging helper, Paginator, for messages (through new method getMessagesPaged)
- Performance improvements for various sync operations
- Improved messages cache
- Fix issues with IE11 and other browsers support
- Fixed a race that caused some messages to be shown twice in message history
- Fixed an issue whereby if a channel sync resulted in a 403, a retry was impossible within the same client session
- Fixed an issue with maximum event listeners limit in user info subscriptions causing a misleading error message
- New: All server-side errors now presented as SessionError class with code and message fields
- BREAKING: ip-messaging sdk doesn't have AccessManager bundled anymore. Which means that twilio-common should be included by user application alongside the IP Messaging JS library, as follows:
1<script src="https://media.twiliocdn.com/sdk/js/common/releases/0.1.7/twilio-common.min.js"></script>2<script src="https://media.twiliocdn.com/sdk/rtc/js/ip-messaging/releases/0.10.12/twilio-ip-messaging.min.js"></script>3
- BREAKING: user now has to wait until promise, returned from Client.initialize(), resolves before using client methods and accessing fields.
- Fixed a bug whereby IE11 did not run the library
- Fixed an error with marking as read first message in a channel (with index 0)
- Fixed a minor whereby private and public channels returned different null indicators for unset FriendlyName
- Future Release: The Twilio Common JS library will no longer be bundled with the IP Messaging JS library and will need to be explicitly imported alongside the IP Messaging JS library.
- UserInfo object with FriendlyName and Attributes
- Exists for the currently logged in User
- Exists for all Member's in Channels
- Events:
- 'userInfoUpdated' event on Client object for use as part of a Global listener
- UserInfo#updated triggers Member#userInfoUpdated and Channel#memberInfoUpdated with instance of Member as an argument.
- Fixed: multiple 'channelUpdated' events on channel join
- Future Release: The Twilio Common JS library will no longer be bundled with the IP Messaging JS library and will need to be explicitly imported alongside the IP Messaging JS library.
- Reverted breaking change introduced in 0.9.3 whereby Twilio Common JS library needed to be explicitly imported alongside the IP Messaging JS library. This change will be re-introduced in the near future as per the above notice.
- Added new events added for Members and Messages at the Client object level
- message added
- messaged removed
- message updated
- member added
- member left
- member joined
- typing started
- typing ended
- Added new convenience Consumption Horizon methods to simplify implementation
- setLastConsumedMessageIndex: - updates the last consumed index to the value specified, if you set an 'earlier' message as the last consumed, it will move the pointer 'backwards'
- advanceLastConsumedMessageIndex: - updates the last consumed index to the value specified but only if the new value is > the existing value in the client
- Fixed a bug whereby Member.isTyping property not set correctly when passed into typingStarted event listener
- Fixed consumption horizon update behavior whereby events consumption events were periodically not sent to the service
- Updated bundled twilio-common to 0.1.4, which should fix issues involving parsing tokens with identities that contain certain character sets.
- Corrected an error in documentation. Descriptions for
Channel.typingStarted
andChannel.typingEnded
were inverted.
- When passing a Capability Token string to the
IPMessaging.Client()
constructor, Client.identity should now be fully URI decoded. - Calling
Client.accessManager.updateToken()
should no longer cause exceptions.
- Twilio's license was updated, and licenses have been added for dependencies.
Feature add: Consumption horizon
Consumption Horizon gives your applications visibility into each Member's consumption of the messages in a Channel. The following methods have been added to support Consumption Horizon:
- Consumption horizon additions:
function Channel.updateLastConsumedMessageIndex(Number index)
int Channel.lastConsumedMessageIndex
int Member.lastConsumedMessageIndex
Date Member.lastConsumptionTimestamp
int Message.index
- API Changes:
Member#updated
will now also fire whenMember.lastConsumedMessageIndex
is updated.Channel#updated
will now also fire whenChannel.lastConsumedMessageIndex
is updated.- New Channel properties:
String Channel.createdBy
Date Channel.dateCreated
Date Channel.dateUpdated