DataDog / dd-sdk-flutter

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

fix(rum): null passed to `addAttribute` should remove attributes #581

Closed fuzzybinary closed 3 months ago

fuzzybinary commented 3 months ago

What and why?

Passing null to addAttribute is causing a telemetry error complaining about a contract violation on the native side. The result is that the attribute wouldn't be changed. This changes it so that if null is passed to addAttribute, it calls removeAttribute instead, which will prevent the contract violation and is likely more consistent with expectations.

How?

If needed, a description of how this PR accomplishes what it does.

Review checklist