vavadiyahiren / xmpp_plugin

XMPP Plugin is developed with help of native channel and exposing sevral features of xmpp using the native libs like smack and xmppframework
Apache License 2.0
36 stars 21 forks source link

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

Open danishrafiqe opened 4 months ago

danishrafiqe commented 4 months ago

@vavadiyahiren after updating package when i use await xmppConnection?.changeTypingStatus( userInfoModel.jid.toString(), TypingStatusEnum.active.name); it gives me (32423): Message messageChat : {customText: , from: 657fec504057da690176d030@chat.swatitech.com, 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 commented 4 months ago

@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