Closed ayaanpathan closed 2 years ago
Did you set the correct data for login to the chat? CubeUser
requires the id
and password
for the chat connection.
yes, the cubeuser which I am using to login has name, email and id
what about a password? Does the user have it?
While logging in i am sending one, but in response it gives me null
you should set it anyway for the chat login
Okay so setting the user's password manually did the trick.
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)
...
====================================================================================================
@TatankaConCube Please note that I'm using sdk v1.1.3 as our App is still on the old version of flutter.
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)
Thanks!
Platform (use [x]) [x] Android [] iOS [] macOS [] Windows [] Web
Describe the bug: Getting this error when logging in to the cube chat
Logs: