Skip to content

Pre release Alpha.20 - v2.0.0

Pre-release
Pre-release

Choose a tag to compare

@Gerben-T Gerben-T released this 01 May 07:54
c678c92

What's Changed

  • Use new client-api endpoint for counting unread messages by @Gerben-T in #69

Full Changelog: v2.0.0-alpha.19...v2.0.0-alpha.20

New features

We now use the new GET /messages/unread/count client api endpoint to check for unread messages. This replaces the GET /messages polling while the chat is closed. If the chat is open it will use that polling again for retrieving the full message objects, like normal.

The polling now works as follows:

  • if the chat is closed and has never been opened in this session it uses the slow unread message count polling. This is the same as in the previous version (except that we now use GET /messages/unread/count
  • if the chat is open it uses the message polling, just like before
  • if the chat is closed after it has been open it will use the unread message count polling but with the same intervals as the message polling, so not "slow".

If we get a count which is greater than 0 the chat will open up (depending on your unreadMessagesAction in the config).

Once the unread messages have been rendered we mark them as "read" in the client api (they are not updated individually, we update all the unread messages that we have in our state once the chat is shown).