-
Notifications
You must be signed in to change notification settings - Fork 237
fix: Make Client.findDM
return a Result
#4816
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
Conversation
The SDK performs some checks on this function that can throw, so we need to guard the client.
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
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.
LGTM, thanks!
@@ -141,7 +141,8 @@ class UserProfilePresenterTest { | |||
if (canFindRoom) { | |||
givenGetRoomResult(A_ROOM_ID, room) | |||
} | |||
givenFindDmResult(dmRoom) | |||
givenFindDmResult(Result.success(dmRoom)) | |||
givenFindDmResult(Result.success(dmRoom)) |
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.
oups!
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.
Ouch, will fix 😅
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4816 +/- ##
===========================================
- Coverage 80.39% 80.39% -0.01%
===========================================
Files 2149 2149
Lines 56838 56842 +4
Branches 7126 7126
===========================================
+ Hits 45697 45699 +2
- Misses 8690 8691 +1
- Partials 2451 2452 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Content
What the title says. If finding the associated DM fails with an exception, the 'start DM' flow will fail too now.
Motivation and context
The SDK performs some checks on this function that can throw, so we need to guard the client.
I found this crash in the rageshakes:
Tests
I'm not exactly sure how to test this other than adding a unit test.
Checklist