stream-chat-js icon indicating copy to clipboard operation
stream-chat-js copied to clipboard

feat: changes to support offline feature

Open vishalnarkhede opened this issue 2 years ago • 1 comments

CLA

  • [ ] I have signed the Stream CLA (required).
  • [ ] Code changes are tested

Description of the changes, What, Why and How?

Purpose of this PR is to add changes to make it possible for UI SDKs to implement offline support.

Changelog

  • Added support for persistUserOnConnectionFailure option on client. Current we unset user and userId property if client.connectUser call fails and we expect customer to call connectUser again to retry. To implement offline support for UI SDKs, we need to persist user and userId even if connectUser fails.
  • Added staticState option for Channel constructor, which represents if the channel has been initialized using static set of messages, members, read etc.
  • A new local event has been introduced 'channels.queried', to let UI sdks know that one or more channels have been queried. This event will be emitted from client.queryChannels() and channel.query() calls. Payload of this event contains following two properties:
    • channels channels received from api call
    • isLatestMessageSet boolean weather latest message set has been queries or some historical one.
  • Refactored some typescript around ChannelAPIResponse.

vishalnarkhede avatar Jul 14 '22 17:07 vishalnarkhede

Size Change: +3.85 kB (+1%)

Total Size: 312 kB

Filename Size Change
dist/browser.es.js 68.1 kB +804 B (+1%)
dist/browser.full-bundle.min.js 37.1 kB +328 B (+1%)
dist/browser.js 69.1 kB +859 B (+1%)
dist/index.es.js 68.2 kB +801 B (+1%)
dist/index.js 69.2 kB +1.06 kB (+2%)

compressed-size-action

github-actions[bot] avatar Jul 14 '22 17:07 github-actions[bot]