Conversation
062fc96 to
3478cfd
Compare
| SelfConv -> Nothing | ||
| ConnectConv -> Nothing | ||
| renderedPage <- mapMaybe mk <$> getConversations (fst $ partitionQualified luid convids) | ||
| renderedPage <- mapMaybe mk <$> E.getConversations (fst $ partitionQualified luid convids) |
There was a problem hiding this comment.
Should E.getConversations not be better e.g. ConversationStore.getConversations as in services/galley/src/Galley/API/Query.hs? (E. translates to Error. in my weird head 😄 )
| Local UserId -> | ||
| Range 1 1000 Int32 -> | ||
| Maybe (Qualified ConvId) -> | ||
| ConversationSubsystem r (ResultSet (Qualified ConvId)) |
There was a problem hiding this comment.
This seems to leak a Cassandra specific type (ResultSet) to upper layers. Is this intended?
integration/test/Test/Meetings.hs
Outdated
|
|
||
| putMeeting otherUser domain meetingId update >>= assertStatus 404 | ||
|
|
||
| testMeetingLists :: (HasCallStack) => App () |
There was a problem hiding this comment.
Shouldn't there be more tests?
E.g.
- There is no meeting for the user -> list none
- There is a meeting for another user, but none for the user to test -> list none
- There are multiple meetings for the user -> list them
These could probably be unit tests as well. However, I found none.
There was a problem hiding this comment.
It would probably also be good to ensure that the pagination works as expected.
There was a problem hiding this comment.
I've added some
| Member ConversationSubsystem r | ||
| ) => | ||
| Maybe (Qualified ConvId) -> | ||
| Sem r [API.Meeting] |
There was a problem hiding this comment.
r has the same constraints here as the r from the containing function. Have you considered to use https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/scoped_type_variables.html#extension-ScopedTypeVariables?
d25ac2c to
c3a2a4f
Compare
| meetings <- resp.json & asList | ||
| length (meetings :: [Value]) `shouldMatchInt` 3 | ||
|
|
||
| testMeetingListPagination :: (HasCallStack) => App () |
There was a problem hiding this comment.
Uhm, how does this test pagination? Are pages only 4 elements? 🤔
There was a problem hiding this comment.
1001 is enough :)
d455d62 to
e2e25ee
Compare
| resp <- getMeetingsList owner | ||
| assertSuccess resp | ||
| meetings <- resp.json & asList | ||
| length (meetings :: [Value]) `shouldMatchInt` 3 |
There was a problem hiding this comment.
BTW - Have you considered to validate the values themselves, not only the count?
There was a problem hiding this comment.
I have validated ids, should I fully validate all fields?
https://wearezeta.atlassian.net/browse/WPB-21964
https://wearezeta.atlassian.net/browse/WPB-24073
Checklist
changelog.d