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

feat: do not display call feed back for short calls (WPB-15086) #3277

Merged
merged 7 commits into from
Feb 18, 2025

Conversation

ohassine
Copy link
Member

@ohassine ohassine commented Feb 4, 2025

EpicWPB-15086 Fixing the cross-platform inconsistencies of the calling.call_quality_review event


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?

Description

Call feed back survey should not displayed if the call is too short, less than 1 minute.

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.

Copy link
Contributor

github-actions bot commented Feb 4, 2025

Test Results

3 520 tests  +1   3 412 ✅ +1   6m 11s ⏱️ -2s
  603 suites ±0     108 💤 ±0 
  603 files   ±0       0 ❌ ±0 

Results for commit f415ef5. ± Comparison against base commit 7f5111d.

This pull request removes 4 and adds 5 tests. Note that renamed tests count towards both.
com.wire.kalium.logic.feature.user.ShouldAskCallFeedbackUseCaseTest ‑ givenNextTimeForCallFeedbackInFuture_whenInvoked_thenFalseIsReturned[jvm]
com.wire.kalium.logic.feature.user.ShouldAskCallFeedbackUseCaseTest ‑ givenNextTimeForCallFeedbackInPast_whenInvoked_thenTrueIsReturned[jvm]
com.wire.kalium.logic.feature.user.ShouldAskCallFeedbackUseCaseTest ‑ givenNextTimeForCallFeedbackIsNegative_whenInvoked_thenFalseIsReturned[jvm]
com.wire.kalium.logic.feature.user.ShouldAskCallFeedbackUseCaseTest ‑ givenNoNextTimeForCallFeedbackSaved_whenInvoked_thenTrueIsReturned[jvm]
com.wire.kalium.logic.feature.user.ShouldAskCallFeedbackUseCaseTest ‑ givenCallDurationLessThanOneMinute_whenInvoked_thenCallDurationIsLessThanOneMinuteIsReturned[jvm]
com.wire.kalium.logic.feature.user.ShouldAskCallFeedbackUseCaseTest ‑ givenNextTimeForCallFeedbackInFuture_whenInvoked_thenNextTimeForCallFeedbackIsNotReachedIsReturned[jvm]
com.wire.kalium.logic.feature.user.ShouldAskCallFeedbackUseCaseTest ‑ givenNextTimeForCallFeedbackInPast_whenInvoked_thenShouldAskCallFeedbackIsReturned[jvm]
com.wire.kalium.logic.feature.user.ShouldAskCallFeedbackUseCaseTest ‑ givenNextTimeForCallFeedbackIsNegative_whenInvoked_thenNextTimeForCallFeedbackIsNotReachedReturned[jvm]
com.wire.kalium.logic.feature.user.ShouldAskCallFeedbackUseCaseTest ‑ givenNoNextTimeForCallFeedbackSaved_whenInvoked_thenShouldAskCallFeedbackIsReturned[jvm]

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Feb 4, 2025

@datadog-wireapp
Copy link

datadog-wireapp bot commented Feb 4, 2025

Datadog Report

Branch report: do-not-display-call-feed-back-for-short-calls
Commit report: 644ac93
Test service: kalium-jvm

✅ 0 Failed, 3412 Passed, 108 Skipped, 1m 1.46s Total Time

@codecov-commenter
Copy link

codecov-commenter commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.70%. Comparing base (7f5111d) to head (f415ef5).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3277   +/-   ##
========================================
  Coverage    50.69%   50.70%           
========================================
  Files         1611     1611           
  Lines        58102    58119   +17     
  Branches      5218     5222    +4     
========================================
+ Hits         29456    29467   +11     
- Misses       26639    26642    +3     
- Partials      2007     2010    +3     

see 8 files with indirect coverage changes


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 7f5111d...f415ef5. Read the comment docs.

}

@Suppress("FunctionNaming")
internal fun ObserveAskCallFeedbackUseCase(
internal fun observeAskCallFeedbackUseCase(
Copy link
Contributor

Choose a reason for hiding this comment

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

question: does it need to be a function that creates anonymous object? Usually we just create

class ObserveAskCallFeedbackUseCaseImpl(
    endCallListener: EndCallResultListener
) : ObserveAskCallFeedbackUseCase {

Copy link
Member

Choose a reason for hiding this comment

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

To be fair, I'd even go the extra mile to make it look like a constructor when invoking. something like internal fun ObserveAskCallFeedbackUseCase. Just looks cleaner than having all Impl classes everywhere :D

}

@Suppress("FunctionNaming")
internal fun ShouldAskCallFeedbackUseCase(
internal fun shouldAskCallFeedbackUseCase(
Copy link
Contributor

Choose a reason for hiding this comment

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

same question here

Copy link
Member

Choose a reason for hiding this comment

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

I'd revert the upper to lowercase change.

Using "fake constructor functions" is a well established Kotlin pattern.

For example, when creating a CoroutineScope: https://github.com/Kotlin/kotlinx.coroutines/blob/fed40ad1f9942d1b16be872cc555e08f965cf881/kotlinx-coroutines-core/common/src/CoroutineScope.kt#L297

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess I just missed the moment when we started doing it that way in use cases 😅
I agree, reverting it to uppercase would be better

@@ -475,7 +475,7 @@ internal class CallDataSource(
val updatedCallMetadata = callMetadataProfile.data.toMutableMap().apply {
this[conversationId] = call.copy(
participants = participants,
maxParticipants = max(call.maxParticipants, participants.size + 1),
maxParticipants = max(call.maxParticipants, participants.size),
Copy link
Member

Choose a reason for hiding this comment

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

How is this related to call feedback? Could Could you please clarify?

Copy link
Member Author

Choose a reason for hiding this comment

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

so in the ticket call_participants event is "The maximum number of users in the call, not necessarily equal to the number of users in the conversation. Detected during the time the user is participating in the call."

Copy link
Member

Choose a reason for hiding this comment

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

I was mostly asking about the +1 removal. I'm not sure why it was there before, and why it is being removed now 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

tbh I don't know why it was added, but certainly it's giving wrong value.

Copy link
Member

Choose a reason for hiding this comment

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

does call.maxParticipants return self ? maybe the +1 is for self ?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes self is already included

}

@Suppress("FunctionNaming")
internal fun ObserveAskCallFeedbackUseCase(
internal fun observeAskCallFeedbackUseCase(
Copy link
Member

Choose a reason for hiding this comment

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

To be fair, I'd even go the extra mile to make it look like a constructor when invoking. something like internal fun ObserveAskCallFeedbackUseCase. Just looks cleaner than having all Impl classes everywhere :D

}

@Suppress("FunctionNaming")
internal fun ShouldAskCallFeedbackUseCase(
internal fun shouldAskCallFeedbackUseCase(
Copy link
Member

Choose a reason for hiding this comment

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

I'd revert the upper to lowercase change.

Using "fake constructor functions" is a well established Kotlin pattern.

For example, when creating a CoroutineScope: https://github.com/Kotlin/kotlinx.coroutines/blob/fed40ad1f9942d1b16be872cc555e08f965cf881/kotlinx-coroutines-core/common/src/CoroutineScope.kt#L297

@MohamadJaara MohamadJaara added this pull request to the merge queue Feb 18, 2025
Merged via the queue into develop with commit 4abd575 Feb 18, 2025
22 checks passed
@MohamadJaara MohamadJaara deleted the do-not-display-call-feed-back-for-short-calls branch February 18, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants