Closed linsdev closed 2 years ago
final pubnub = PubNub(...); pubnub.batch.fetchMessages('channelName', includeUUID: false);
batch.fetchMessages with parameter includeUUID: false failed because BatchHistoryResultEntry.fromJson not check includeUUID parameter.
batch.fetchMessages
includeUUID: false
BatchHistoryResultEntry.fromJson
BatchHistoryResultEntry.fromJson constructor from /lib/src/dx/_endpoints/history.dart:
class BatchHistoryResultEntry { ... /// UUID of the sender. String uuid; ... factory BatchHistoryResultEntry.fromJson(Map<String, dynamic> object, {CipherKey? cipherKey, Function? decryptFunction}) { return BatchHistoryResultEntry._( cipherKey == null ? object['message'] : decryptFunction!(cipherKey, object['message']), Timetoken(BigInt.parse(object['timetoken'])), object['uuid'], // <-- the problem here MessageTypeExtension.fromInt(object['message_type']), object['actions'], object['meta'] == '' ? null : object['meta']); } }
object['uuid'] can be null but uuid field cannot.
object['uuid']
uuid
@linsdev this issue is addressed in v4.1.3
batch.fetchMessages
with parameterincludeUUID: false
failed becauseBatchHistoryResultEntry.fromJson
not check includeUUID parameter.BatchHistoryResultEntry.fromJson
constructor from /lib/src/dx/_endpoints/history.dart:object['uuid']
can be null butuuid
field cannot.