pusher / chatkit-client-js

JavaScript client SDK for Pusher Chatkit
https://pusher.com/chatkit
MIT License
90 stars 15 forks source link

trouble with hook onNewReadCursor #214

Closed tstocker closed 4 years ago

tstocker commented 5 years ago

Hello. I'm working on a app using chatkits hooks on cursors. chatkit version : @pusher/chatkit-client@1.11.0

setReadCursor is call when a user open a room or send a message. Then we catch the cursor with the hook onNewReadCursor

this.chatManager.connect({
  onNewReadCursor: cursor => {
    console.log('onNewReadCursor');
    messageReader(cursor.roomId).then(receipts => {
      store.dispatch(updateRecipients({ cursor: cursor, receipts: receipts[0] }));
    }).catch(err => { console.err(err); });
  },
});

All was working fine each time, till we merge the code to an other branch. Code is the same on each branch for chatkit cursor usage. onNewReadCursor is never called on the new branch, i can't see any log in onNewReadCursor callback, others hooks works.

Is their any trouble with onNewReadCursor ? If you need more details don't hesitate. can you help me please on that subject ? Thanks

callum-oakley commented 4 years ago

@tstocker you mentioned it was working before a merge, it sounds like something in the merge must have broken it. Have you confirmed that the setReadCursor call is still happening in the merged code?

tstocker commented 4 years ago

thanks you send me in the right way looks their was some change in the object structure we send on setReadCursor. works now

callum-oakley commented 4 years ago

Good to hear! Thanks for the update. :)