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: typing indicator receiver events and observability (WPB-4591) #2069

Merged
merged 26 commits into from
Sep 25, 2023

Conversation

yamilmedina
Copy link
Contributor

@yamilmedina yamilmedina commented Sep 18, 2023


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?

This is the receiving part of typing indicator events, STARTED and STOPPED

Solutions

Given that typing indicator events are transient = true, we are not persisting it, but rather handling them in memory.
There will come another PR for expiring this cache entries, accordingly to specs, for now we expect that other clients always send STOPPED

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

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.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 18, 2023

Unit Test Results

       2 files   - 435         2 suites   - 435   11s ⏱️ - 2m 15s
1 834 tests  - 542  1 825 ✔️  - 448  9 💤  - 94  0 ±0 

Results for commit fdb6f1d. ± Comparison against base commit 47c310d.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

codecov-commenter commented Sep 18, 2023

Codecov Report

Merging #2069 (fdb6f1d) into develop (47c310d) will decrease coverage by 0.03%.
The diff coverage is 50.58%.

@@              Coverage Diff              @@
##             develop    #2069      +/-   ##
=============================================
- Coverage      57.95%   57.93%   -0.03%     
  Complexity        24       24              
=============================================
  Files           1012     1016       +4     
  Lines          38020    38104      +84     
  Branches        3458     3466       +8     
=============================================
+ Hits           22035    22076      +41     
- Misses         14501    14542      +41     
- Partials        1484     1486       +2     
Files Changed Coverage Δ
...in/com/wire/kalium/logic/data/event/EventMapper.kt 17.50% <0.00%> (-0.63%) ⬇️
...um/logic/feature/conversation/ConversationScope.kt 0.00% <0.00%> (ø)
.../feature/conversation/ObserveUsersTypingUseCase.kt 0.00% <0.00%> (ø)
...enticated/conversation/TypingIndicatorStatusDTO.kt 0.00% <0.00%> (ø)
...base/authenticated/notification/EventContentDTO.kt 50.81% <12.50%> (-1.29%) ⬇️
...n/kotlin/com/wire/kalium/logic/data/event/Event.kt 82.61% <53.33%> (-0.81%) ⬇️
...gic/data/conversation/TypingIndicatorRepository.kt 88.88% <88.88%> (ø)
...ic/sync/receiver/handler/TypingIndicatorHandler.kt 90.00% <90.00%> (ø)
...ire/kalium/logic/data/conversation/Conversation.kt 92.81% <100.00%> (+0.04%) ⬆️
...m/logic/sync/receiver/ConversationEventReceiver.kt 100.00% <100.00%> (ø)
... and 1 more

... and 3 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 47c310d...fdb6f1d. Read the comment docs.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Sep 18, 2023

Datadog Report

All test runs 2f08083 🔗

2 Total Test Services: 0 Failed, 0 with New Flaky, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Branch View
kalium-ios 0 0 0 1798 43 5m 13.09s Link
kalium-jvm 0 0 0 2280 103 11m 15s Link

Copy link
Contributor

@gongracr gongracr left a comment

Choose a reason for hiding this comment

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

So far looking in great shape! 🧑‍⚕️ ⚕️ Let me know when you mark this PR as final to approve it 🍎

@yamilmedina yamilmedina marked this pull request as ready for review September 18, 2023 13:54
@yamilmedina yamilmedina requested review from a team, gongracr and alexandreferris and removed request for a team September 18, 2023 13:55
Copy link
Member

@vitorhugods vitorhugods left a comment

Choose a reason for hiding this comment

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

Looking good, just a couple of minor issues maybe.

class TypingIndicatorRepositoryImpl : TypingIndicatorRepository {

private val userTypingDataSourceFlow = MutableSharedFlow<Unit>(extraBufferCapacity = 1, onBufferOverflow = BufferOverflow.DROP_OLDEST)
private val userTypingCache = ConcurrentMutableMap<ConversationId, Set<ExpiringUserTyping>>()
Copy link
Member

Choose a reason for hiding this comment

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

This makes it so this Repository needs to be "static" a.k.a. we need to create one for each user, can't just have getters like most repositories.

It would be nice to make this more explicit by passing the MutableMap<ConversationId, Set<ExpiringUserTyping>> as a parameter in the constructor.

Copy link
Contributor Author

@yamilmedina yamilmedina Sep 24, 2023

Choose a reason for hiding this comment

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

Good idea, done !

Copy link
Contributor

@gongracr gongracr left a comment

Choose a reason for hiding this comment

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

Great stuff as usual 🥧

@datadog-wireapp
Copy link

Datadog Report

All test runs 2f08083 🔗

2 Total Test Services: 0 Failed, 0 with New Flaky, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Branch View
kalium-ios 0 0 0 1798 43 5m 13.09s Link
kalium-jvm 0 0 0 2280 103 11m 15s Link

@yamilmedina yamilmedina added this pull request to the merge queue Sep 25, 2023
Merged via the queue into develop with commit 048b06f Sep 25, 2023
15 checks passed
@yamilmedina yamilmedina deleted the epic/typing-indicator-receiver branch September 25, 2023 10:09
@echoes-hq echoes-hq bot added the echoes: product-roadmap Work aligned with the customer-announced roadmap, targeting a specific release date. label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: product-roadmap Work aligned with the customer-announced roadmap, targeting a specific release date. 🚨 Potential breaking changes 👕 size: XL type: feature ✨
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants