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
onMessageDeleted
hook is passed tosubscribeToRoom
- A bug which would under certain circumstances cause calls to fetch users by ID to not be properly batched.
- A
disableCursors
option forsubscribeToRoomMultipart
which 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.
enablePushNotifications
now takesshowNotificationsTabOpen
andshowNotificationsTabClosed
options which enable or disable notifications when there is a tab open or closed.
- Support for
pushNotificationTitleOverride
increateRoom
andupdateRoom
methods.
- Enabling push notifications now also enables notifications when the application tab is open but hidden.
enablePushNotifications
takes anonClick
callback 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
id
parameter to thecreateRoom
method.
- 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
onMessageDeleted
hook
unreadCount
andlastMessageAt
properties 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
, andsubscribeToRoomMultipart
all use the new multipart message format.
sendMessage
,fetchMessages
, andsubscribeToRoom
are depricated in favour of their multipart counterparts. They will be removed in a future major release.
- The
TokenProvider
now accepts awithCredentials
option which it forwards toXMLHttpRequest
internally. 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/platform
dependency to 0.16.0 and so reconnections are much more reliable now (thanks @albertopriore in particular for helping with debugging)
- The
deletedAt
field is populated on the room object (it will beundefined
unless the room has been deleted)
- The message attachment object now has a
name
field
- Move the dependency
pusher-platform
to@pusher/platform
- Reduce time taken to reconnect broken websocket connection (e.g. network change or plug pulled) on Chrome by 60 seconds.
- A
customData
option forcreateRoom
andupdateRoom
- A
customData
property on the room object throughout
- Re-includes the react-native.js adapter in the published package.
1.0.4 - 2018-11-05
- The
users
property on the room object. - Subscribe to user's own presence state.
-
The
fetchRequired
property on message attachments is no longer defined (fetch is never required any more, just use the provided link directly). -
The
fetchAttachment
method is removed from the current user object since it is never required. -
renames
onNewMessage
toonMessage
-
onPresenceChanged
replacesonUserCameOnline
andonUserWentOffline
. Takes parameters(state, user)
-- wherestate
is{ current, previous }
andcurrent
andprevious
are 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 theChatManager
constructor.
0.7.14 - 2018-06-12
- Adds a
disconnect
method toChatManager
which 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.js
to 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.js
to satisfycreate-react-app
's build script.
0.7.5 - 2018-03-26
- type check the
private
option toupdateRoom
rather than casting, so that default isundefined
notfalse
.
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
getAllRooms
from the current user. It only causes confusion. Anyone usinggetAllRooms
can 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
,onFailure
callbacks 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
hooks
throughout. e.g.
currentUser.subscribeToRoom({
roomId,
hooks: {
onNewMessage: m => {},
},
})
-
Hooks all prefixed with
on
. e.g.onNewMessage
,onUserStartedTyping
-
cursorSet
hook renamed toonNewCursor
-
authContext.queryParams
andauthContext.headers
both 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',
...
}
})
-
addUser
andremoveUser
renamed toaddUserToRoom
andremoveUserFromRoom
-
methods that used to accept a
Room
object now accept aroomId
. e.g.
instead of
currentUser.subscribeToRoom(myRoom, hooks) // WRONG
do
currentUser.subscribeToRoom({ roomId: myRoom.id, hooks })
-
The behaviour of read cursors has changed: in particular cursors are now accessed via
currentUser.readCursor
and 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
messageLimit
argument insubscribeToRoom
was being validated as a number. - Ensured that the
position
argument insetCursor
is 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
startedTypingIn
andstoppedTypingIn
methods - instead call
isTypingIn
as frequently as you like (rate limited by the SDK) startedTyping
andstoppedTyping
are fired exactly once each per burst of typing
- removed
0.5.1 - 2018-01-16
- Fixed
fetchMessageFromRoom
which wasn't passing along the values provided in theFetchRoomMessagesOptions
parameter as query params. Thanks @apalmer0!
0.5.0 - 2018-01-09
ChatManager
takes auserId
as a required option,TokenProvider
no longer does. (ChatManager
passes the user ID to the token provider internally before requesting a token.)
-
RoomDelegate
has acursorSet
callback, fired whenever a cursor is set in the given room. -
CurrentUser
has asetCursor
method, to set a cursor in a given room. -
The
CurrentUser
object now has acursors
property, 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
addMessage
has been renamed tosendMessage
and 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)
},
)
sendMessage
supports adding an attachment to a message. See the docs for more information.
Older releases are not covered by this changelog.