Don't throw exception when Intercom provider gets more than 10 attributes#27
Don't throw exception when Intercom provider gets more than 10 attributes#27jahunt1 merged 1 commit intoalignops:masteralignops/AnalyticsKit-Android:masterfrom jahunt1:intercom-quiet-modejahunt1/AnalyticsKit-Android:intercom-quiet-modeCopy head branch name to clipboard
Conversation
| { | ||
| sanitizedAttributes = new LinkedHashMap<>(); | ||
| int count = 0; | ||
| for (String key : event.getAttributes().keySet()) |
There was a problem hiding this comment.
I missed the Kotlin collections functions here so badly! 😣
I am contemplating how I can convert this library's code to Kotlin, but I'm wondering what kind of DSL if any we should use.
There was a problem hiding this comment.
Java is so bad compared to Kotlin lol. This could be done in Kotlin for half the amount of code.
If you have time to convert the project to Kotlin I'm all for it. It's up to you.
As for using a DSL. You could have a simple DSL for consuming this library like
AnalyticsKit {
registerProvider {
provider1
}
registerProvider {
provider2
}
}
There was a problem hiding this comment.
Thanks, this is a great suggestion!. I'll keep this in mind.
| { | ||
| sanitizedAttributes = new LinkedHashMap<>(); | ||
| int count = 0; | ||
| for (String key : event.getAttributes().keySet()) |
There was a problem hiding this comment.
Java is so bad compared to Kotlin lol. This could be done in Kotlin for half the amount of code.
If you have time to convert the project to Kotlin I'm all for it. It's up to you.
As for using a DSL. You could have a simple DSL for consuming this library like
AnalyticsKit {
registerProvider {
provider1
}
registerProvider {
provider2
}
}
This PR adds a "quiet mode" to the Intercom provider that allows consumers of this library to just take the first 10 metadata items from each event without throwing an
IllegalStateException.Side note: I reviewed the Intercom Documentation, and they have increased the metadata limit from 5 to 10 since I last went through it.