Skip to content

Fix the enable logic for destinations #68

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

Merged
merged 1 commit into from
Jan 12, 2022
Merged

Conversation

prayansh
Copy link
Contributor

  • Fix the enable logic for destinations
  • Fix SegmentDestination to adhere to update API contracts

@codecov-commenter
Copy link

Codecov Report

Merging #68 (41a6776) into main (65d5419) will increase coverage by 26.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##               main      #68       +/-   ##
=============================================
+ Coverage     57.71%   83.75%   +26.04%     
+ Complexity      418      407       -11     
=============================================
  Files            66       54       -12     
  Lines          7137     4482     -2655     
  Branches        690      583      -107     
=============================================
- Hits           4119     3754      -365     
+ Misses         2506      244     -2262     
+ Partials        512      484       -28     
Impacted Files Coverage Δ
...java/com/segment/analytics/kotlin/core/Settings.kt 75.92% <ø> (-0.86%) ⬇️
...m/segment/analytics/kotlin/core/platform/Plugin.kt 72.88% <100.00%> (+0.46%) ⬆️
...kotlin/core/platform/plugins/SegmentDestination.kt 56.00% <100.00%> (+0.89%) ⬆️
...om/segment/analytics/kotlin/core/AnalyticsTests.kt 78.92% <0.00%> (-0.39%) ⬇️
...ava/com/segment/analytics/kotlin/core/Analytics.kt 75.67% <0.00%> (-0.22%) ⬇️
...cs/destinations/plugins/FirebaseDestinationTest.kt
...s/destinations/plugins/MixpanelDestinationTests.kt
.../destinations/plugins/AppsflyerDestinationTests.kt
.../segment/analytics/kotlin/android/utils/Plugins.kt
...tics/kotlin/android/AndroidLifecyclePluginTests.kt
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 65d5419...41a6776. Read the comment docs.

Copy link
Contributor

@wenxi-zeng wenxi-zeng left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -101,6 +101,7 @@ class SegmentDestination : DestinationPlugin() {
}

override fun update(settings: Settings, type: Plugin.UpdateType) {
super.update(settings, type)
if (settings.hasIntegrationSettings(this)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

since we're calling super, can we reuse enabled here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ideally yes, but this is more of a check for the presence of settings, which could be none in the case of manually enabled destinations

@prayansh prayansh merged commit 43c1a6c into main Jan 12, 2022
@prayansh prayansh deleted the pray/fix-update-enable branch January 12, 2022 18:45
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.

3 participants