Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: event bus integration with push #358

Merged

Conversation

Shahroz16
Copy link
Contributor

closes: https://linear.app/customerio/issue/MBL-346/event-bus-integration-with-feature-modules

  • Integrated Eventbus with Pus
  • Decouple PushTrackingUtilImpl from Tracking to demonstrate changes which are gonna follow by next PRs

@Shahroz16 Shahroz16 requested a review from a team June 12, 2024 21:41
Copy link

github-actions bot commented Jun 12, 2024

Sample app builds 📱

Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.


  • java_layout: mbl-346-event-bus-integration-with-feature-modules (1718678402)
  • kotlin_compose: mbl-346-event-bus-integration-with-feature-modules (1718678388)

Copy link

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.90%. Comparing base (48c64c9) to head (8346aba).
Report is 45 commits behind head on feature/cdp.

Additional details and impacted files
@@                Coverage Diff                 @@
##             feature/cdp     #358       +/-   ##
==================================================
+ Coverage          54.45%   90.90%   +36.44%     
==================================================
  Files                109        1      -108     
  Lines               2534       11     -2523     
  Branches             355        2      -353     
==================================================
- Hits                1380       10     -1370     
+ Misses              1032        1     -1031     
+ Partials             122        0      -122     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Build available to test
Version: mbl-346-event-bus-integration-with-feature-modules-SNAPSHOT
Repository: https://s01.oss.sonatype.org/content/repositories/snapshots/

Copy link

github-actions bot commented Jun 12, 2024

📏 SDK Binary Size Comparison Report

No changes detected in SDK binary size ✅

Copy link
Contributor

@mrehan27 mrehan27 left a comment

Choose a reason for hiding this comment

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

Looks good 👍🏻

// https://github.com/mockk/mockk/issues/681
jvmArgs("--add-opens", "java.base/java.time=ALL-UNNAMED",
"--add-opens", "java.base/java.util=ALL-UNNAMED"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

For future, once we have all modules using JUnit5, we can pull these changes up to common gradle file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, that's the plan 👍

@@ -91,6 +93,10 @@ open class CustomerIOFirebaseMessagingService : FirebaseMessagingService() {
}

private fun handleNewToken(context: Context, token: String) {
eventBus.publish(
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest to either create class variable or use SDKComponent.eventBus for improved readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm i thought import or event clicking on it would be sufficient, I can add the extended name just felt like a overhead.

event = MetricEvent.delivered
eventBus.publish(
Event.TrackPushMetricEvent(
event = MetricEvent.delivered.name,
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be outside the scope of this PR, but curious if there is a reason for using String instead of MetricEvent enum? Is this for wrappers flexibility?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MetricEvent has a Moshi dependency to it, which we will be getting rid of. So pulling it in core didn't make sense, on top of that wrappers would also not be using it.

End goal would be to create another enum and replace the string and remove the tracking one.

@Shahroz16 Shahroz16 merged commit 61d19a2 into feature/cdp Jun 18, 2024
28 of 33 checks passed
@Shahroz16 Shahroz16 deleted the mbl-346-event-bus-integration-with-feature-modules branch June 18, 2024 02:47
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.

None yet

2 participants