This project adheres to Semantic Versioning Scheme
- The token provider constructor will now additionally accept functions for
url,queryParams, andheaders. Thanks zoozalp.
- Logs a warning if
onMessageDeletedhook is passed tosubscribeToRoom
- A bug which would under certain circumstances cause calls to fetch users by ID to not be properly batched.
- A
disableCursorsoption forsubscribeToRoomMultipartwhich opts out of receiving other user's cursors.
- Bump push-notifications-web version. This will return a descriptive error if an invalid service worker registration is given to the SDK.
- Bump pusher-platform-js version. No changes to the public interface.
enablePushNotificationsnow takesshowNotificationsTabOpenandshowNotificationsTabClosedoptions which enable or disable notifications when there is a tab open or closed.
- Support for
pushNotificationTitleOverrideincreateRoomandupdateRoommethods.
- Enabling push notifications now also enables notifications when the application tab is open but hidden.
enablePushNotificationstakes anonClickcallback which is fired when one of these notifications is clicked, and passed the relevant room ID.
- Support for pushNotificationTitleOverride in createRoom & updateRoom
- Bump lodash version for security patch.
- Internal improvements to web push notifications
- Support for user specified room IDs. Provide an
idparameter to thecreateRoommethod.
- Better error messages for web push integrations:
- Log a warning when using an unsupported browser
- Raise an exception with a more helpful error message when it is detected that the service worker is missing.
- Bad pinned version of push notifications dependency
- Beta support for web push notifications (currently Chrome-only)
- Check for non-null content (rather than falsy) in message parsing so that empty content doesn't throw an error
- Support the
onMessageDeletedhook
unreadCountandlastMessageAtproperties on room objects which contain the number of unread messages and the timestamp of the most recent message in a room.
- Throw an error if file to attach doesn't have a size.
- Multipart messaging support:
sendSimpleMessage,sendMultipartMessage,fetchMessagesMultipart, andsubscribeToRoomMultipartall use the new multipart message format.
sendMessage,fetchMessages, andsubscribeToRoomare depricated in favour of their multipart counterparts. They will be removed in a future major release.
- The
TokenProvidernow accepts awithCredentialsoption which it forwards toXMLHttpRequestinternally. See here.
- a race condition when subscribing to the same room twice in very quick succession
- buffer room events until all relevant subscriptions are complete
- On reconnection hooks will now be fired for events that were missed during disconnection.
- Race condition between leaving a room and receiving the removed-from-room event (the latter will now always fire).
- Errors when unsubscribing while receiving an event.
- Update the
@pusher/platformdependency to 0.16.0 and so reconnections are much more reliable now (thanks @albertopriore in particular for helping with debugging)
- The
deletedAtfield is populated on the room object (it will beundefinedunless the room has been deleted)
- The message attachment object now has a
namefield
- Move the dependency
pusher-platformto@pusher/platform
- Reduce time taken to reconnect broken websocket connection (e.g. network change or plug pulled) on Chrome by 60 seconds.
- A
customDataoption forcreateRoomandupdateRoom - A
customDataproperty on the room object throughout
- Re-includes the react-native.js adapter in the published package.
1.0.4 - 2018-11-05
- The
usersproperty on the room object. - Subscribe to user's own presence state.
-
The
fetchRequiredproperty on message attachments is no longer defined (fetch is never required any more, just use the provided link directly). -
The
fetchAttachmentmethod is removed from the current user object since it is never required. -
renames
onNewMessagetoonMessage -
onPresenceChangedreplacesonUserCameOnlineandonUserWentOffline. Takes parameters(state, user)-- wherestateis{ current, previous }andcurrentandpreviousare one of"online","offline", or"unknown". -
Room memberships (the user property on rooms) are now available only after subscribing to a room. Attempting to access them before subscribing will throw an error.
-
room IDs are now strings everywhere
0.7.18 - 2018-10-12
- Increased default connection timeout from 10 to 20 seconds
- Bump pusher-platform-js dependency to 0.15.2
0.7.17 - 2018-06-18
- Internal fix to ensure that the room is properly returned from
leaveRoom. No external change.
0.7.16 - 2018-06-18
- The connection timeout introduced in 0.7.13 is configurable by passing
connectionTimeout(milliseconds) to theChatManagerconstructor.
0.7.14 - 2018-06-12
- Adds a
disconnectmethod toChatManagerwhich disconnects a user from Chatkit.
0.7.13 - 2018-06-12
- Subscriptions will now time out after 5s if no initial state is received.
0.7.12 - 2018-04-30
- Uploads files to path scoped by user ID (no external change)
0.7.11 - 2018-04-30
- Batch set cursor requests (no external change)
0.7.9 - 2018-04-10
- De-duplicate user information requests.
- Send SDK info headers along with every request (version, platform, etc).
0.7.8 - 2018-04-04
- Remove the es build because it was causing problems with webpack. If we want to add it back later more investigation and testing will be required.
0.7.7 - 2018-04-03
- Point
es.jsto the es module build not the web build.
0.7.6 - 2018-04-03
- Fill in a sensible default for missing presence data so we don't have to explicitly check for undefined.
- Use ES5 syntax in
es.jsto satisfycreate-react-app's build script.
0.7.5 - 2018-03-26
- type check the
privateoption toupdateRoomrather than casting, so that default isundefinednotfalse.
0.7.4 - 2018-03-20
- es module build for named imports and tree shaking when consuming the SDK with rollup
0.7.3 - 2018-03-20
- removed
getAllRoomsfrom the current user. It only causes confusion. Anyone usinggetAllRoomscan replace swap it out for something like the following:
// instead of this
currentUser.getAllRooms().then(allRooms => {
doTheThing(allRooms)
})
// do this
currentUser.getJoinableRooms().then(joinable => {
doTheThing(joinable.concat(currentUser.rooms))
})0.7.2 - 2018-03-19
- Subobjects of the current user (Rooms, Users, etc) are now mutated instead of replaced, so any reference to a room will represent the up to date state of that room.
- Remove chatty logs about requiring room membership after leaving a room
0.7.0 - 2018-03-13
This version represents a radical departure from 0.6.X. The interface is very different, and there's a good chance we'll miss some of the changes in this log. If something isn't working after migration, the best place to look first is probably the documentation.
- Methods with
onSuccess,onFailurecallbacks changed to return promises instead. e.g.
chatManager
.connect()
.then(currentUser => {})
.catch(err => {})-
All methods take a single object parameter (see the documentation for details on each method's arguments)
-
Delegates renamed to
hooksthroughout. e.g.
currentUser.subscribeToRoom({
roomId,
hooks: {
onNewMessage: m => {},
},
})-
Hooks all prefixed with
on. e.g.onNewMessage,onUserStartedTyping -
cursorSethook renamed toonNewCursor -
authContext.queryParamsandauthContext.headersboth moved to the root options object in the token provider. e.g.
const tokenProvider = new TokenProvider({
url: 'your.auth.url',
queryParams: {
someKey: someValue,
...
},
headers: {
SomeHeader: 'some-value',
...
}
})-
addUserandremoveUserrenamed toaddUserToRoomandremoveUserFromRoom -
methods that used to accept a
Roomobject now accept aroomId. e.g.
instead of
currentUser.subscribeToRoom(myRoom, hooks) // WRONGdo
currentUser.subscribeToRoom({ roomId: myRoom.id, hooks })-
The behaviour of read cursors has changed: in particular cursors are now accessed via
currentUser.readCursorand set withcurrentUser.setReadCursor. See the Read Cursors section of the documentation for details. -
Presence data is now accessable on any user object under
user.presence. e.g.
const isOnline = user.presence.state === "online"- All users that share a common room membership are accesable under
currentUser.users, and all members of a room are accessable underroom.users.
0.6.2 - 2018-02-05
- Catch errors in cursors get request
0.6.1 - 2018-01-25
- Made sure that the
messageLimitargument insubscribeToRoomwas being validated as a number. - Ensured that the
positionargument insetCursoris a valid number. - Throw an error if the userId isn't provided to the ChatManager.
0.6.0 - 2018-01-19
- Simplify typing indicator API
- removed
startedTypingInandstoppedTypingInmethods - instead call
isTypingInas frequently as you like (rate limited by the SDK) startedTypingandstoppedTypingare fired exactly once each per burst of typing
- removed
0.5.1 - 2018-01-16
- Fixed
fetchMessageFromRoomwhich wasn't passing along the values provided in theFetchRoomMessagesOptionsparameter as query params. Thanks @apalmer0!
0.5.0 - 2018-01-09
ChatManagertakes auserIdas a required option,TokenProviderno longer does. (ChatManagerpasses the user ID to the token provider internally before requesting a token.)
-
RoomDelegatehas acursorSetcallback, fired whenever a cursor is set in the given room. -
CurrentUserhas asetCursormethod, to set a cursor in a given room. -
The
CurrentUserobject now has acursorsproperty, which contains all the user's own cursors, mapped by room ID. This is guaranteed to be populated before room subscriptions succeed, so e.g.currentUser.cursors[roomId]can be used upon receiving messages to determine if they have been read already.
0.4.0 - 2018-01-04
- Add initial support for receiving cursors.
0.3.2 - 2017-12-19
addMessagehas been renamed tosendMessageand now expects a different set of parameters:
What previously would have been this:
currentUser.addMessage(
"Hi there! 👋",
myRoom,
messageId => {
console.log("Success!", messageId)
},
error => {
console.log("Error", error)
},
)now needs to be written like this:
currentUser.sendMessage(
{
text: "Hey there!",
roomId: myRoom.id,
},
messageId => {
console.log("Success!", messageId)
},
error => {
console.log("Error", error)
},
)sendMessagesupports adding an attachment to a message. See the docs for more information.
Older releases are not covered by this changelog.