ConnectyCube / connectycube-flutter-sdk-releases

ConnectyCube Flutter SDK Releases
7 stars 1 forks source link

Getting unknown error #70

Closed ayaanpathan closed 2 years ago

ayaanpathan commented 2 years ago

Platform (use [x]) [x] Android [] iOS [] macOS [] Windows [] Web

Describe the bug: Getting this error when logging in to the cube chat

Logs:

[log] ---Xmpp Receiving:---
[log] <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='chat.connectycube.com' id='9e581bfb-fdbb-4e41-a648-83a9ba1a7833' version='1.0' xml:lang='en'>
[log] D/[Connection]: processInitialStream
[log] ---Xmpp Receiving:---
[log] <stream:features><sm xmlns="urn:xmpp:sm:3"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>PLAIN_FAST</mechanism></mechanisms><ver xmlns="urn:xmpp:features:rosterver"/><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression></stream:features>
[log] D/[ConnectionNegotiatorManager]: Negotiating features
[log] D/[ConnectionNegotiatorManager]: Found matching negotiator true
E/flutter (17941): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Invalid argument(s)
E/flutter (17941): #0      _StringBase.+ (dart:core-patch/string_patch.dart:267:57)
E/flutter (17941): #1      PlainSaslHandler.sendPlainAuthMessage (package:xmpp_stone/src/features/sasl/PlainSaslHandler.dart:42:57)
E/flutter (17941): #2      PlainSaslHandler.start (package:xmpp_stone/src/features/sasl/PlainSaslHandler.dart:25:5)
E/flutter (17941): #3      SaslAuthenticationFeature._process (package:xmpp_stone/src/features/sasl/SaslAuthenticationFeature.dart:64:19)
E/flutter (17941): #4      SaslAuthenticationFeature.negotiate (package:xmpp_stone/src/features/sasl/SaslAuthenticationFeature.dart:38:7)
E/flutter (17941): #5      ConnectionNegotiatorManager.negotiateNextFeature (package:xmpp_stone/src/features/ConnectionNegotatiorManager.dart:83:24)
E/flutter (17941): #6      ConnectionNegotiatorManager.negotiateFeatureList (package:xmpp_stone/src/features/ConnectionNegotatiorManager.dart:65:5)
E/flutter (17941): #7      Connection.handleResponse.<anonymous closure> (package:xmpp_stone/src/Connection.dart:311:43)
E/flutter (17941): #8      Iterable.forEach (dart:core/iterable.dart:283:30)
E/flutter (17941): #9      Connection.handleResponse (package:xmpp_stone/src/Connection.dart:310:12)
E/flutter (17941): #10     _rootRunUnary (dart:async/zone.dart:1198:47)
E/flutter (17941): #11     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (17941): #12     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (17941): #13     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
E/flutter (17941): #14     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
E/flutter (17941): #15     _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:127:11)
E/flutter (17941): #16     _MapStream._handleData (dart:async/stream_pipe.dart:224:10)
E/flutter (17941): #17     _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:157:13)
E/flutter (17941): #18     _rootRunUnary (dart:async/zone.dart:1198:47)
E/flutter (17941): #19     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (17941): #20     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (17941): #21     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
E/flutter (17941): #22     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
E/flutter (17941): #23     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:69:11)
E/flutter (17941): #24     _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
E/flutter (17941): #25     _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)
E/flutter (17941): #26     _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:243:7)
E/flutter (17941): #27     _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:317:20)
E/flutter (17941): #28     _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310:5)
E/flutter (17941): #29     _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)
E/flutter (17941): #30     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:121:24)
E/flutter (17941): #31     _rootRunUnary (dart:async/zone.dart:1198:47)
E/flutter (17941): #32     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (17941): #33     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (17941): #34     CastStreamSubscription._onData (dart:_internal/async_cast.dart:85:11)
E/flutter (17941): #35     _rootRunUnary (dart:async/zone.dart:1198:47)
E/flutter (17941): #36     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (17941): #37     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (17941): #38     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
E/flutter (17941): #39     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
E/flutter (17941): #40     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:808:19)
E/flutter (17941): #41     _StreamController._add (dart:async/stream_controller.dart:682:7)
E/flutter (17941): #42     _StreamController.add (dart:async/stream_controller.dart:624:5)
E/flutter (17941): #43     _Socket._onData (dart:io-patch/socket_patch.dart:2044:41)
E/flutter (17941): #44     _rootRunUnary (dart:async/zone.dart:1198:47)
E/flutter (17941): #45     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (17941): #46     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (17941): #47     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
E/flutter (17941): #48     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
E/flutter (17941): #49     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:808:19)
E/flutter (17941): #50     _StreamController._add (dart:async/stream_controller.dart:682:7)
E/flutter (17941): #51     _StreamController.add (dart:async/stream_controller.dart:624:5)
E/flutter (17941): #52     _RawSecureSocket._sendReadEvent (dart:io/secure_socket.dart:1002:19)
E/flutter (17941): #53     _rootRun (dart:async/zone.dart:1182:47)
E/flutter (17941): #54     _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter (17941): #55     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
E/flutter (17941): #56     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
E/flutter (17941): #57     _rootRun (dart:async/zone.dart:1190:13)
E/flutter (17941): #58     _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter (17941): #59     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1021:23)
E/flutter (17941): #60     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
E/flutter (17941): #61     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:397:19)
E/flutter (17941): #62     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)
E/flutter (17941): #63     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
E/flutter (17941): 
TatankaConCube commented 2 years ago

Did you set the correct data for login to the chat? CubeUser requires the id and password for the chat connection.

ayaanpathan commented 2 years ago

yes, the cubeuser which I am using to login has name, email and id

TatankaConCube commented 2 years ago

what about a password? Does the user have it?

ayaanpathan commented 2 years ago

While logging in i am sending one, but in response it gives me null

TatankaConCube commented 2 years ago

you should set it anyway for the chat login

ayaanpathan commented 2 years ago

Okay so setting the user's password manually did the trick.

ayaanpathan commented 2 years ago

Hi @TatankaConCube. When I send an attachment, the url of the image comes back null.

[log] ---Xmpp Sending:---
[log] <r xmlns="urn:xmpp:sm:3"/>
I/flutter ( 3579): CB-SDK: : *********************************************************
I/flutter ( 3579): *** RESPONSE *** 201 *** 294ab975-3656-4247-ac43-a42c613927fa ***
I/flutter ( 3579): HEADERS
I/flutter ( 3579):   {cb-token-expirationdate: 2021-12-08 09:17:08 UTC, connection: keep-alive, date: Wed, 08 Dec 2021 07:17:08 GMT, strict-transport-security: max-age=15768000; includeSubDomains, content-length: 1420, access-control-expose-headers: CB-Token-ExpirationDate, content-type: application/json; charset=utf-8, server: nginx/1.16.1}
I/flutter ( 3579): BODY
I/flutter ( 3579):   {"blob":{"id":650805,"_id":"61b05bf477984b00340f387f","created_at":"2021-12-08T07:17:08Z","updated_at":"2021-12-08T07:17:08Z","uid":"5640D4AE9D606CDC2D3685FC5B471D25F377","content_type":"image/jpeg","name":"IMG20211203082151.jpg","user_id":5207181,"public":false,"blob_object_access":{"id":650805,"blob_id":650805,"expires":"2021-12-08T08:17:08.245Z","object_access_type":"Write","params":"https://s3.amazonaws.com/cb-shared-s3?Content-Type=image%2Fjpeg&Policy=eyJleHBpcmF0aW9uIjoiMjAyMS0xMi0wOFQwODoxNzowOFoiLCJjb25kaXRpb25zIjpbeyJhY2wiOiJhdXRoZW50aWNhdGVkLXJlYWQifSx7IkNvbnRlbnQtVHlwZSI6ImltYWdlL2pwZWcifSx7InN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyI6IjIwMSJ9LHsiZXhwaXJlcyI6IldlZCwgMDggRGVjIDIwMjEgMDg6MTc6MDggR01UIn0seyJrZXkiOiI1NjQwRDRBRTlENjA2Q0RDMkQzNjg1RkM1QjQ3MUQyNUYzNzcifSx7ImJ1Y2tldCI6ImNiLXNoYXJlZC1zMyJ9LHsiWC1BbXotQWxnb3JpdGhtIjoiQVdTNC1ITUFDLVNIQTI1NiJ9LHsiWC1BbXotQ3JlZGVudGlhbCI6IkFLSUFUNVhUVDZRN01aVUdTWlg1LzIwMjExMjA4L3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSx7IlgtQW16LURhdGUiOiIyMDIxMTIwOFQwNzE3MDhaIn1dfQ%3D%3D&X-A
I/flutter ( 3579): 
I/flutter ( 3579): CB-SDK: : =========================================================
I/flutter ( 3579): === REQUEST ==== AMAZON === 8baf868e-340e-441b-8035-a62c85dabb7d ===
I/flutter ( 3579): REQUEST
I/flutter ( 3579):   POST https://s3.amazonaws.com/cb-shared-s3 
I/flutter ( 3579): HEADERS
I/flutter ( 3579):   {}
I/flutter ( 3579): FIELDS
I/flutter ( 3579):   {Content-Type: image/jpeg, Policy: eyJleHBpcmF0aW9uIjoiMjAyMS0xMi0wOFQwODoxNzowOFoiLCJjb25kaXRpb25zIjpbeyJhY2wiOiJhdXRoZW50aWNhdGVkLXJlYWQifSx7IkNvbnRlbnQtVHlwZSI6ImltYWdlL2pwZWcifSx7InN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyI6IjIwMSJ9LHsiZXhwaXJlcyI6IldlZCwgMDggRGVjIDIwMjEgMDg6MTc6MDggR01UIn0seyJrZXkiOiI1NjQwRDRBRTlENjA2Q0RDMkQzNjg1RkM1QjQ3MUQyNUYzNzcifSx7ImJ1Y2tldCI6ImNiLXNoYXJlZC1zMyJ9LHsiWC1BbXotQWxnb3JpdGhtIjoiQVdTNC1ITUFDLVNIQTI1NiJ9LHsiWC1BbXotQ3JlZGVudGlhbCI6IkFLSUFUNVhUVDZRN01aVUdTWlg1LzIwMjExMjA4L3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSx7IlgtQW16LURhdGUiOiIyMDIxMTIwOFQwNzE3MDhaIn1dfQ==, X-Amz-Algorithm: AWS4-HMAC-SHA256, X-Amz-Credential: AKIAT5XTT6Q7MZUGSZX5/20211208/us-east-1/s3/aws4_request, X-Amz-Date: 20211208T071708Z, X-Amz-Signature: 6b01b5f983fb2f018eb39f7a597c3342c094e33a337e754c3ba216d396e6cb8c, acl: authenticated-read, bucket: cb-shared-s3, expires: Wed, 08 Dec 2021 08:17:08 GMT, key: 5640D4AE9D606CDC2D3685FC5B471D25F377, success_action_status: 201}
I/flutter ( 3579): 
[log] ---Xmpp Receiving:---
[log] <a xmlns='urn:xmpp:sm:3' h='12'/>
I/flutter ( 3579): CB-SDK: : *********************************************************
I/flutter ( 3579): *** RESPONSE *** AMAZON *** 201 *** 8baf868e-340e-441b-8035-a62c85dabb7d ***
I/flutter ( 3579): HEADERS
I/flutter ( 3579):   {location: https://s3.amazonaws.com/cb-shared-s3/5640D4AE9D606CDC2D3685FC5B471D25F377, date: Wed, 08 Dec 2021 07:17:10 GMT, content-length: 286, etag: "91d152b794a9987ae9d1ecf46ae57e23", x-amz-request-id: C0MZD9T8BH5YHZ7V, content-type: application/xml, x-amz-id-2: Be++5PQfL30IWuwPfkaCl32VaCOAUousaZgIRb+JZpTNo0fN7D4OIPjalObo4ZK0ZVE9rHGrFvU=, server: AmazonS3}
I/flutter ( 3579): RESPONSE
I/flutter ( 3579):   <?xml version="1.0" encoding="UTF-8"?>
I/flutter ( 3579): <PostResponse><Location>https://s3.amazonaws.com/cb-shared-s3/5640D4AE9D606CDC2D3685FC5B471D25F377</Location><Bucket>cb-shared-s3</Bucket><Key>5640D4AE9D606CDC2D3685FC5B471D25F377</Key><ETag>"91d152b794a9987ae9d1ecf46ae57e23"</ETag></PostResponse>
I/flutter ( 3579): 
I/flutter ( 3579): CB-SDK: : =========================================================
I/flutter ( 3579): === REQUEST ==== edc3b7df-504e-4eeb-ba88-dcd72109253a ===
I/flutter ( 3579): REQUEST
I/flutter ( 3579):   POST https://api.connectycube.com/blobs/650805/complete 
I/flutter ( 3579): HEADERS
I/flutter ( 3579):   {Content-type: application/json, ConnectyCube-REST-API-Version: 0.1.1, CB-SDK: Flutter 1.1.3, CB-Token: C66557448F833198DAE9E59E167D83D007BA}
I/flutter ( 3579): BODY
I/flutter ( 3579):   {"blob":{"size":2401989}}
I/flutter ( 3579): 
I/flutter ( 3579): CB-SDK: : *********************************************************
I/flutter ( 3579): *** RESPONSE *** 200 *** edc3b7df-504e-4eeb-ba88-dcd72109253a ***
I/flutter ( 3579): HEADERS
I/flutter ( 3579):   {cb-token-expirationdate: 2021-12-08 09:17:11 UTC, connection: keep-alive, date: Wed, 08 Dec 2021 07:17:11 GMT, content-length: 0, strict-transport-security: max-age=15768000; includeSubDomains, access-control-expose-headers: CB-Token-ExpirationDate, server: nginx/1.16.1}
I/flutter ( 3579): BODY
I/flutter ( 3579):   
I/flutter ( 3579): 
I/flutter ( 3579): CB-SDK: : onSendMessage message= {_id: 61b05bf6db9b3e9e93d42e19, chat_dialog_id: null, message: Attachment, date_sent: 1638947830, sender_id: null, recipient_id: null, read_ids: null, delivered_ids: null, views_count: null, attachments: [{id: 5640D4AE9D606CDC2D3685FC5B471D25F377, uid: null, type: image, url: null, content-type: null, size: null, name: null, data: null, width: 3072, height: 4096, duration: null}], id: null, created_at: null, updated_at: null}
I/flutter ( 3579): THIS IS THE SENDER IDnull
[log] ---Xmpp Sending:---
I/flutter ( 3579): THIS IS THE ATTACHMENT[{id: 5640D4AE9D606CDC2D3685FC5B471D25F377, uid: null, type: image, url: null, content-type: null, size: null, name: null, data: null, width: 3072, height: 4096, duration: null}]
[log] <message id="61b05bf6db9b3e9e93d42e19" type="chat" to="5211124-5731@chat.connectycube.com">
  <body>Attachment</body>
  <extraParams xmlns="jabber:client">
    <date_sent>1638947830</date_sent>
    <save_to_history>1</save_to_history>
    <dialog_id>61b04de66d7e6e00217306fd</dialog_id>
    <attachment id="5640D4AE9D606CDC2D3685FC5B471D25F377" type="image" width="3072" height="4096"/>
  </extraParams>
  <markable xmlns="urn:xmpp:chat-markers:0"/>
</message>
I/flutter ( 3579): THIS IS THE ATTACHMENT[]
I/flutter ( 3579): CB-SDK: : [getReadDeliveredWidget]
I/flutter ( 3579): CB-SDK: : [getReadDeliveredWidget] messageIsRead
I/flutter ( 3579): CB-SDK: : [getReadDeliveredWidget] messageIsDelivered
I/flutter ( 3579): CB-SDK: : [getReadDeliveredWidget] sent

======== Exception caught by widgets library =======================================================
The following assertion was thrown building:
'package:cached_network_image/src/cached_image_widget.dart': Failed assertion: line 231 pos 16: 'imageUrl != null': is not true.

When the exception was thrown, this was the stack: 
#2      new CachedNetworkImage (package:cached_network_image/src/cached_image_widget.dart:231:16)
#3      ChatScreenState.buildItem (package:being_pupil/ConnectyCube/chat_dialog_screen.dart:450:33)
#4      ChatScreenState.buildListMessage.getWidgetMessages.<anonymous closure> (package:being_pupil/ConnectyCube/chat_dialog_screen.dart:777:42)
#5      SliverChildBuilderDelegate.build (package:flutter/src/widgets/sliver.dart:449:22)
#6      SliverMultiBoxAdaptorElement._build (package:flutter/src/widgets/sliver.dart:1130:28)
...
====================================================================================================
ayaanpathan commented 2 years ago

@TatankaConCube Please note that I'm using sdk v1.1.3 as our App is still on the old version of flutter.

TatankaConCube commented 2 years ago

how do you set the URL for attachment? if you use private type for uploaded files you should use the method getPrivateUrlForUid(uid) for dynamic building an URL. In this case, the sender should send only an uid of the uploaded file and the receiver builds the dynamic URL via getPrivateUrlForUid(uid)

ayaanpathan commented 2 years ago

Thanks!