DataDog / dd-sdk-flutter

Flutter bindings and tools for utilizing Datadog Mobile SDKs
Apache License 2.0
41 stars 40 forks source link

[datadog_gql_link]Multipart request doesn't work #618

Closed atsumo closed 3 weeks ago

atsumo commented 1 month ago

Describe the bug

When I try to execute a mutation with a multipart request, an error occurs during the jsonEncode process of datadog_gql_link, causing the entire operation to fail.

Reproduction steps

final graphQlUrl = "https://example.com/graphql";

final link = Link.from([
  DatadogGqlLink(DatadogSdk.instance, Uri.parse(graphQlUrl)),
  HttpLink(graphQlUrl),
]);

when request MultipartFile parsed mutation

SDK logs

No response

Expected behavior

No response

Affected SDK versions

1.0.0 ~

Latest working SDK version

No response

Did you confirm if the latest SDK version fixes the bug?

Yes

Flutter Version

No response

Setup Type

No response

Device Information

No response

Other relevant information

No response

fuzzybinary commented 1 month ago

Hi @atsumo

Do you get a stack trace that you can share?

atsumo commented 1 month ago

@fuzzybinary I apologize for not sharing the error message. This is error message

 flutter: Converting object to an encodable object failed: Instance of 'MultipartFile'
 flutter: #0      _JsonStringifier.writeObject (dart:convert/json.dart:793:7)
           #1      _JsonStringifier.writeMap (dart:convert/json.dart:874:7)
           #2      _JsonStringifier.writeJsonValue (dart:convert/json.dart:829:21)
           #3      _JsonStringifier.writeObject (dart:convert/json.dart:784:9)
           #4      _JsonStringifier.writeList (dart:convert/json.dart:841:7)
           #5      _JsonStringifier.writeJsonValue (dart:convert/json.dart:823:7)
           #6      _JsonStringifier.writeObject (dart:convert/json.dart:784:9)
           #7      _JsonStringifier.writeMap (dart:convert/json.dart:874:7)
           #8      _JsonStringifier.writeJsonValue (dart:convert/json.dart:829:21)
           #9      _JsonStringifier.writeObject (dart:convert/json.dart:784:9)
           #10     _JsonStringStringifier.printOn (dart:convert/json.dart:982:17)
           #11     _JsonStringStringifier.stringify (dart:convert/json.dart:967:5)
           #12     JsonEncoder.convert (dart:convert/json.dart:345:30)
           #13     JsonCodec.encode (dart:convert/json.dart:231:45)
           #14     jsonEncode (dart:convert/json.dart:114:10)
           #15   <…>
"Unhandled Client-Side Exception: Converting object to an encodable object failed: Instance of 'MultipartFile'"
fuzzybinary commented 1 month ago

Okay, I'll try to take a look this week.

fuzzybinary commented 1 month ago

Sorry can you also provide me with an example mutation that you're running?

fuzzybinary commented 3 weeks ago

This should now be fixed in v1.1.1

atsumo commented 3 weeks ago

@fuzzybinary Thank you I will try it!