You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sending an AttachmentFIle without a name, I get an unhelpful error message from the server:
StreamChatNetworkError(code: 4, message: UploadFile failed with error: "http: no such file", statusCode: 400, data: ErrorResponse(code: 4, message: UploadFile failed with error: "http: no such file", statusCode: 400, moreInfo: https://getstream.io/chat/docs/api_errors_response))
Workaround
I fixed it by giving it a name.
Solution
I think it would be helpful if the AttachmentFile requires a name in its asserts if it is indeed a requirement of the api. I found it confusing that the server complained about a filename, where it was the name that I needed to change.
It makes sense now that I've solved it but I think it would definitely help onboarding devs.
Steps to reproduce
1. Send an attachment with the given structure
Supporting info to reproduce
Example request
final data =Uint8List(0);
StreamChannel.of(context)
.channel
.sendMessage(Message(type:'voicenote', attachments: [
Attachment(
file:AttachmentFile(
bytes: data,
size: data.length,
),
)
]))
Which packages are you using?
stream_chat_flutter
On what platforms did you experience the issue?
Web
What version are you using?
6.9.0
What happened?
Issue
When sending an AttachmentFIle without a name, I get an unhelpful error message from the server:
Workaround
I fixed it by giving it a name.
Solution
I think it would be helpful if the AttachmentFile requires a name in its asserts if it is indeed a requirement of the api. I found it confusing that the server complained about a filename, where it was the name that I needed to change.
It makes sense now that I've solved it but I think it would definitely help onboarding devs.
Steps to reproduce
Supporting info to reproduce
Example request
Relevant log output
Flutter analyze output
Flutter doctor output
Code of Conduct
The text was updated successfully, but these errors were encountered: