Open jordanterry opened 3 weeks ago
@jordanterry we created internal bug ticket for this, we will fix it very soon.
@jordanterry Current Limitation Our SDK is implemented in Java, which does not natively support mutable maps as method parameters. Due to this language constraint, we are unable to add methods that accept mutable maps as parameters. Planned Fix We acknowledge that this limitation has led to crashes when users attempt to pass mapOf() or emptyMap() as arguments. We want to assure you that we are actively working on a solution to address this issue.
@ndesai-newrelic would it be possible to create a mutable map internally? The fix doesn't necessarily have to be on the public API.
Here a HashMap
is created:
When I get a free moment I can open a PR if that helps?
@jordanterry that's already done, it will release soon.
Description
When a
kotlin.collection.Map
(derived from a function that returns an immutable map) is passed as a parameter toNewRelic.recordBreadcrumb
a runtime exception is thrown.Steps to Reproduce
Populated Immutable Map
Code:
Runtime Exception:
Empty Immutable Map
Code:
Runtime Exception:
Using
mutableMapOf
If I try to use
mutableMapOf
I see an error in my IDE.Expected Behavior
I should be able to use any
Map
without IDE issues or runtime exceptions when recording a breadcrumb.Relevant Logs / Console output
Logs provided above.
Your Environment
Kotlin + Android