xmpp_plugin icon indicating copy to clipboard operation
xmpp_plugin copied to clipboard

Unhandled Exception: type 'String' is not a subtype of type 'TypingStatus?'

Open danishrafiqe opened this issue 1 year ago • 1 comments

@vavadiyahiren after updating package when i use await xmppConnection?.changeTypingStatus( userInfoModel.jid.toString(), TypingStatusEnum.active.name); it gives me (32423): Message messageChat : {customText: , from: [email protected], senderJid: , time: 0, id: UPGVL-7, type: Ack, body: , msgtype: normal, bubbleType: , mediaURL: , isReadSent: 0, delayTime: 0, chatStateType: } E/flutter (32423): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'String' is not a subtype of type 'TypingStatus?' E/flutter (32423): #0 new ChatState.fromJson (package:xmpp_plugin/models/chat_state_model.dart:38) E/flutter (32423): #1 XmppConnection.start.. (package:xmpp_plugin/xmpp_plugin.dart:140) E/flutter (32423): #2 List.forEach (dart:core-patch/growable_array.dart:416) E/flutter (32423): #3 XmppConnection.start. (package:xmpp_plugin/xmpp_plugin.dart:129) E/flutter (32423): #4 _RootZone.runUnaryGuarded (dart:async/zone.dart:1594) E/flutter (32423): #5 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339) E/flutter (32423): #6 _DelayedData.perform (dart:async/stream_impl.dart:515) E/flutter (32423): #7 _PendingEvents.handleNext (dart:async/stream_impl.dart:620) E/flutter (32423): #8 _PendingEvents.schedule. (dart:async/stream_impl.dart:591) E/flutter (32423): #9 _microtaskLoop (dart:async/schedule_microtask.dart:40) E/flutter (32423): #10 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49) E/flutter (32423):

this is enum class enum TypingStatusEnum { composing, active, gone, inactive, paused }

danishrafiqe avatar Feb 20 '24 07:02 danishrafiqe

@vavadiyahiren it make issue in parsing model in chatstate it have from: eventData['from'] ?? '', senderJid: eventData['senderJid'] ?? '', id: eventData['id'] ?? '', type: eventData['type'] ?? '', msgtype: eventData['msgtype'] ?? '', chatStateType: eventData['chatStateType'] ?? '', but in some cases i receive 10 keys and values these four is parse but remaining make exception

danishrafiqe avatar Feb 20 '24 08:02 danishrafiqe