-
Notifications
You must be signed in to change notification settings - Fork 6
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
chore: one on one conversation details [WPB-15479] #3260
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small log we need to remove, anyway lgtm !
logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepository.kt
Outdated
Show resolved
Hide resolved
Test Results3 417 tests +1 3 309 ✅ +1 6m 14s ⏱️ -10s Results for commit 1bd7602. ± Comparison against base commit e21b0a8. This pull request removes 1 and adds 2 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
|
Branch | chore/one-on-one-conversation-details |
Testbed | ubuntu-latest |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholds
CLI flag.
Click to view all benchmark results
Benchmark | Latency | microseconds (µs) |
---|---|---|
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInFiles | 📈 view plot | 694.40 |
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInMemory | 📈 view plot | 524,812.00 |
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.messageInsertionBenchmark | 📈 view plot | 1,345,162.42 |
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.queryMessagesBenchmark | 📈 view plot | 22,354.58 |
|
Datadog ReportBranch report: ✅ 0 Failed, 3309 Passed, 108 Skipped, 1m 4.52s Total Time |
selectActiveOneOnOneConversationDetails: | ||
SELECT * FROM ConversationDetails | ||
WHERE qualifiedId = (SELECT active_one_on_one_conversation_id FROM User WHERE qualified_id = :user_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend using a JOIN instead of a subquery, it is more efficient.
SELECT ConversationDetails.*
FROM ConversationDetails
JOIN User ON ConversationDetails.qualifiedId = User.active_one_on_one_conversation_id
WHERE User.qualified_id = :user_id;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I analyzed the performance of both queries using EXPLAIN ANALYZE in SQLite. The execution plans are identical, both queries utilize the same indexes and have no significant performance difference.
Since there's no additional cost for the subquery, the choice between JOIN and WHERE (SELECT …) comes down to readability and preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok.. thanks for checking
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3260 +/- ##
===========================================
- Coverage 53.98% 53.98% -0.01%
===========================================
Files 1303 1303
Lines 37446 37454 +8
Branches 3781 3781
===========================================
+ Hits 20216 20220 +4
- Misses 15809 15812 +3
- Partials 1421 1422 +1
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
GetOneToOneConversationUseCase
toGetOneToOneConversationDetailsUseCase
which will returnConversationDetails.OneOne
to have access to information about folders