pubnub / dart

PubNub Dart SDK
Other
28 stars 15 forks source link

messageAction coming without UUID - required to implement group receipts #15

Closed devopsokdone closed 4 years ago

devopsokdone commented 4 years ago

While adding messageAction we are adding UUID

below is the code for adding messageAction:

var result = await client.addMessageAction( ourEntity.entity["type"], ourEntity.entity["value"], ourEntity.channel, Timetoken(ourEntity.timeTokenValue)); print("uuid" + result.data.uuid);

below is the output based on this code, on messageAction sender side:

result = {AddMessageActionResult} _status = 200 _data = {MessageAction} type = "receipt" value = "delivered" actionTimetoken = "15990275006608580" messageTimetoken = "15990274867947560" uuid = "abcuser" _error = null

but while receiving the messageAction UUID is missing, without this we cannot figure out which user has sent the receipt in a multi user group:

{source: actions, version: 1.0, data: {messageTimetoken: 15990253633518319, type: receipt, value: delivered, actionTimetoken: 15990253638833420}, event: added}

Also while testing and writing samples, multiuser channels should be kept in mind as base criteria, because expecting people will only use it for 1on1 communication is the opposite of a massively scalable tag line.

mohitpubnub commented 4 years ago

Hi, looking at response I am assuming that you are getting that event:added on subscription. In subscription, envelope has sender's uuid which will tell you who has added that message action. Just to figure out the issue, I would like to know are you trying something like this? -

subscription.messages.listen((envelope) {
    if (envelope.messageType == MessageType.messageAction &&
        envelope.payload['source'] == 'actions' &&
        envelope.payload['event'] == 'added') {
      print('${envelope.uuid} has added message action .... ');
    }
  });
devopsokdone commented 4 years ago

Thanks we managed to get UUID with your suggestion.