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

fix: Segmentation missing for countly events (WPB-14646) #3816

Merged
merged 10 commits into from
Jan 27, 2025

Conversation

ohassine
Copy link
Member

@ohassine ohassine commented Jan 22, 2025

BugWPB-14646 [Android] Segmentation missing for countly events


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

Some events are missing some segmentations:
For example app_version, device_model and os_version are not included in ui.QR-click

Causes (Optional)

Not implemented

Dependencies (Optional)

If there are some other pull requests related to this one (e.g. new releases of frameworks), specify them here.

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.

Notes (Optional)

Specify here any other facts that you think are important for this issue.

Attachments (Optional)

Attachments like images, videos, etc. (drag and drop in the text box)


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@echoes-hq echoes-hq bot added the echoes: product-roadmap/bug Work contributing to resolve a bug not critical enough to have raised an incident. label Jan 22, 2025
@ohassine ohassine requested review from a team, typfel, sbakhtiarov, MohamadJaara, saleniuk and mathias-niboulies and removed request for a team January 22, 2025 12:14
@@ -257,7 +261,12 @@ interface AnalyticsEvent {
}

sealed class QrCode : AnalyticsEvent {
data class Click(val isTeam: Boolean) : QrCode() {
data class Click(
Copy link
Contributor

Choose a reason for hiding this comment

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

question: why still only some of them get these new fields? Wouldn't be better to add it to all of them? Maybe even inside the sendEvent method so that they are always added in one place 🤔

class AnonymousAnalyticsRecorderImpl(private val appVersion: String) : AnonymousAnalyticsRecorder {
...
override fun sendEvent(event: AnalyticsEvent) = wrapCountlyRequest {
        Countly.sharedInstance()?.events()?.recordEvent(
            event.key,
            event.toSegmentation().toMutableMap()
                .plus("app_version" to appVersion)
                .plus("device_model" to Build.MODEL)
                .plus("os_version" to Build.VERSION.RELEASE)
        )
    }

Copy link
Member Author

Choose a reason for hiding this comment

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

I am following product specs not all events are having that, but you have a good point better to add those three segmentations to all events.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also think we could add these parameters to all events. In case we do not want to do that, maybe we can have another sendWithAppInfo fun, or new withAppInfo: Boolean = false parameter in sendEvent to avoid repeating these parameters every time we call sendEvent

@@ -257,7 +261,12 @@ interface AnalyticsEvent {
}

sealed class QrCode : AnalyticsEvent {
data class Click(val isTeam: Boolean) : QrCode() {
data class Click(
Copy link
Contributor

Choose a reason for hiding this comment

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

I also think we could add these parameters to all events. In case we do not want to do that, maybe we can have another sendWithAppInfo fun, or new withAppInfo: Boolean = false parameter in sendEvent to avoid repeating these parameters every time we call sendEvent

@ohassine ohassine requested a review from saleniuk January 27, 2025 08:50
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.

Project coverage is 45.44%. Comparing base (1cc0cec) to head (2f31ad6).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...id/ui/userprofile/self/SelfUserProfileViewModel.kt 0.00% 3 Missing ⚠️
...rc/main/kotlin/com/wire/android/WireApplication.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3816   +/-   ##
========================================
  Coverage    45.43%   45.44%           
========================================
  Files          490      490           
  Lines        16895    16900    +5     
  Branches      2833     2833           
========================================
+ Hits          7677     7680    +3     
- Misses        8432     8434    +2     
  Partials       786      786           
Files with missing lines Coverage Δ
...n/kotlin/com/wire/android/ui/home/HomeViewModel.kt 64.81% <100.00%> (+1.35%) ⬆️
...serprofile/teammigration/TeamMigrationViewModel.kt 88.67% <100.00%> (+0.21%) ⬆️
...rc/main/kotlin/com/wire/android/WireApplication.kt 0.00% <0.00%> (ø)
...id/ui/userprofile/self/SelfUserProfileViewModel.kt 55.39% <0.00%> (-0.81%) ⬇️

Continue to review full report in Codecov by Sentry.

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

@ohassine ohassine enabled auto-merge January 27, 2025 10:36
@ohassine ohassine added this pull request to the merge queue Jan 27, 2025
Merged via the queue into develop with commit 25f96c5 Jan 27, 2025
11 of 13 checks passed
@ohassine ohassine deleted the event-segmentations branch January 27, 2025 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: product-roadmap/bug Work contributing to resolve a bug not critical enough to have raised an incident. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants