Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Don't throw exception when Intercom provider gets more than 10 attributes#27

Merged
jahunt1 merged 1 commit into
alignops:masteralignops/AnalyticsKit-Android:masterfrom
jahunt1:intercom-quiet-modejahunt1/AnalyticsKit-Android:intercom-quiet-modeCopy head branch name to clipboard
Feb 3, 2022
Merged

Don't throw exception when Intercom provider gets more than 10 attributes#27
jahunt1 merged 1 commit into
alignops:masteralignops/AnalyticsKit-Android:masterfrom
jahunt1:intercom-quiet-modejahunt1/AnalyticsKit-Android:intercom-quiet-modeCopy head branch name to clipboard

Conversation

@jahunt1

@jahunt1 jahunt1 commented Feb 3, 2022

Copy link
Copy Markdown
Contributor

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.

{
sanitizedAttributes = new LinkedHashMap<>();
int count = 0;
for (String key : event.getAttributes().keySet())

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
      }
  }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a great suggestion!. I'll keep this in mind.

{
sanitizedAttributes = new LinkedHashMap<>();
int count = 0;
for (String key : event.getAttributes().keySet())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
      }
  }

@jahunt1 jahunt1 merged commit b54c2bd into alignops:master Feb 3, 2022
@jahunt1 jahunt1 deleted the intercom-quiet-mode branch February 3, 2022 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.