Skip to content

support enable/disable analytics #169

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 6 commits into from
Jun 5, 2023
Merged

Conversation

wenxi-zeng
Copy link
Contributor

  • support enable/disable analytics
  • fix log leaks
  • fix non-hierarchical deeplink crash

@wenxi-zeng wenxi-zeng requested a review from didiergarcia June 2, 2023 18:47
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 75.45% and project coverage change: +5.27 🎉

Comparison is base (4e595de) 79.28% compared to head (deb2f63) 84.56%.

❗ Current head deb2f63 differs from pull request most recent head cedd664. Consider uploading reports for the commit cedd664 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #169      +/-   ##
============================================
+ Coverage     79.28%   84.56%   +5.27%     
+ Complexity      474      466       -8     
============================================
  Files            74       66       -8     
  Lines          5968     5196     -772     
  Branches        721      656      -65     
============================================
- Hits           4732     4394     -338     
+ Misses          667      247     -420     
+ Partials        569      555      -14     
Impacted Files Coverage Δ
...nalytics/kotlin/core/platform/EventPipelineTest.kt 50.73% <37.50%> (-8.44%) ⬇️
...kotlin/core/platform/plugins/SegmentDestination.kt 74.07% <64.28%> (+2.33%) ⬆️
...ment/analytics/kotlin/core/compat/JavaAnalytics.kt 74.46% <75.00%> (+7.80%) ⬆️
...om/segment/analytics/kotlin/core/AnalyticsTests.kt 72.32% <75.00%> (+0.15%) ⬆️
.../analytics/kotlin/core/compat/JavaAnalyticsTest.kt 67.53% <75.00%> (+0.51%) ⬆️
...nt/analytics/kotlin/core/platform/EventPipeline.kt 96.26% <83.33%> (-0.83%) ⬇️
...ava/com/segment/analytics/kotlin/core/Analytics.kt 76.70% <100.00%> (+0.96%) ⬆️
...in/java/com/segment/analytics/kotlin/core/State.kt 95.31% <100.00%> (+1.08%) ⬆️
...analytics/kotlin/core/utilities/StorageImplTest.kt 85.57% <100.00%> (+0.14%) ⬆️
...n/com/segment/analytics/kotlin/core/utils/Mocks.kt 97.14% <100.00%> (+0.08%) ⬆️

... and 15 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment on lines +25 to +26
for (parameter in uri.queryParameterNames) {
val value = uri.getQueryParameter(parameter)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use "it" instead of "uri" to keep consistent?

Comment on lines +71 to +74
if (writeChannel.isClosedForSend || writeChannel.isClosedForReceive) {
writeChannel = Channel(UNLIMITED)
uploadChannel = Channel(UNLIMITED)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If we use a new channel is possible we leave messages that are stuck in the pipe and loose them when we create a new pipe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah. that's possible. but we're using channel.cancel in stop, buffered events are going to be cleared anyway

the only workaround is not to close/cancel channel at all, but that increases the complexity, since we would have to distinguish pause vs stop. if stop, we would want to close anything ongoing completely, for example on application shutdown.

@wenxi-zeng wenxi-zeng merged commit a414dd9 into main Jun 5, 2023
@wenxi-zeng wenxi-zeng deleted the wenxi/log-through-segmentLog branch June 5, 2023 15:16
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