pubnub / js-chat

PubNub JavaScript Chat SDK
https://github.com/pubnub/js-chat
8 stars 7 forks source link

Error parsing - Soft Delete Message #182

Open manfe opened 5 days ago

manfe commented 5 days ago

I soft delete message

And when I try to get the message.deleted property is returning:

image

[Exception: TypeError: Cannot read properties of undefined (reading 'length') at get deleted (webpack-internal:///(app-pages-browser)/./node_modules/@pubnub/chat/dist/index.es.js:24:10057) at b.invokeGetter (<anonymous>:3:28)]

This [type][type] can be the issue?

https://github.com/pubnub/js-chat/blob/0d2d26139d1f282fdd4d664670190f6a1c4803b2/lib/src/entities/message.ts#L222C38-L222C73

manfe commented 5 days ago

BTW, I tried to remove one [type], but that is marking as false it stopped the undefined error, but not working as expected.

I am going to use the message.actions.deleted to overcome this issue for now.

manfe commented 5 days ago

Here is the return for the this.actions on this line

{
  deleted: {
    ".": [
      { 
        uuid: "admin-43",
        actionTimetoken: "17290191373945210"
      }
    ];
  }
}

Also a screen shot just for reference:

image

piotr-suwala commented 5 days ago

Thank you for reporting the issue. We will take a look at this at the next planning session.