-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[MBL-1025] Update User object with server value for isBlocked #1891
Conversation
@@ -240,7 +240,7 @@ internal final class MessagesViewModelTests: TestCase { | |||
self.scheduler.advance() | |||
|
|||
self.messages.assertValueCount(1) | |||
self.replyButtonIsEnabled.assertValues([false, false, true]) | |||
self.replyButtonIsEnabled.assertValues([false, true, true]) |
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.
This change is because the user template now has the isBlocked
explicitly set, so the isBlocked == false
check causes true to be emitted instead. (I also changed isBlocked to be required to avoid weirdness like this in the future; optional bools are weird, especially when we expect them to actually exist.)
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.
This comment would also be good in the code!
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1891 +/- ##
==========================================
- Coverage 87.76% 83.70% -4.06%
==========================================
Files 861 1225 +364
Lines 77019 111585 +34566
Branches 20426 29687 +9261
==========================================
+ Hits 67592 93402 +25810
- Misses 8686 17161 +8475
- Partials 741 1022 +281 ☔ View full report in Codecov by Sentry. |
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.
nice once!
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.
👍
📲 What
This makes the
isBlocked
bool use the server value, for theUser
model (and theAuthor
subset), whether it's fetched using GraphQL or v1. Tests are updated as well.Note: I also switched
isBlocked
to a required instead of an optional bool, since that feels easier to use. If it's missing from the server for some reason, we default tofalse
.👀 See
Jira
✅ Acceptance criteria
Author
/graphQL)isBlocked
corresponds to whether or not the user is actually blocked (testsUser
/v1)isBlocked
to theAuthor