Skip to content

WPB-21964: Add Wire Meetings list#5109

Open
blackheaven wants to merge 3 commits intodevelopfrom
gdifolco/WPB-21964-list-meetings
Open

WPB-21964: Add Wire Meetings list#5109
blackheaven wants to merge 3 commits intodevelopfrom
gdifolco/WPB-21964-list-meetings

Conversation

@blackheaven
Copy link
Contributor

@blackheaven blackheaven commented Mar 10, 2026

https://wearezeta.atlassian.net/browse/WPB-21964

https://wearezeta.atlassian.net/browse/WPB-24073

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@blackheaven blackheaven requested review from a team as code owners March 10, 2026 17:02
@blackheaven blackheaven force-pushed the gdifolco/WPB-21964-list-meetings branch from 062fc96 to 3478cfd Compare March 10, 2026 17:11
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Mar 10, 2026
SelfConv -> Nothing
ConnectConv -> Nothing
renderedPage <- mapMaybe mk <$> getConversations (fst $ partitionQualified luid convids)
renderedPage <- mapMaybe mk <$> E.getConversations (fst $ partitionQualified luid convids)
Copy link
Contributor

Choose a reason for hiding this comment

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

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 😄 )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed!

Local UserId ->
Range 1 1000 Int32 ->
Maybe (Qualified ConvId) ->
ConversationSubsystem r (ResultSet (Qualified ConvId))
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to leak a Cassandra specific type (ResultSet) to upper layers. Is this intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dropped!


putMeeting otherUser domain meetingId update >>= assertStatus 404

testMeetingLists :: (HasCallStack) => App ()
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

It would probably also be good to ensure that the pagination works as expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added some

Member ConversationSubsystem r
) =>
Maybe (Qualified ConvId) ->
Sem r [API.Meeting]
Copy link
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used!

@blackheaven blackheaven force-pushed the gdifolco/WPB-21964-list-meetings branch 2 times, most recently from d25ac2c to c3a2a4f Compare March 10, 2026 21:56
@blackheaven blackheaven requested a review from supersven March 11, 2026 08:29
meetings <- resp.json & asList
length (meetings :: [Value]) `shouldMatchInt` 3

testMeetingListPagination :: (HasCallStack) => App ()
Copy link
Contributor

Choose a reason for hiding this comment

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

Uhm, how does this test pagination? Are pages only 4 elements? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1001 is enough :)

@blackheaven blackheaven force-pushed the gdifolco/WPB-21964-list-meetings branch from d455d62 to e2e25ee Compare March 11, 2026 09:34
resp <- getMeetingsList owner
assertSuccess resp
meetings <- resp.json & asList
length (meetings :: [Value]) `shouldMatchInt` 3
Copy link
Contributor

Choose a reason for hiding this comment

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

BTW - Have you considered to validate the values themselves, not only the count?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have validated ids, should I fully validate all fields?

@blackheaven blackheaven requested a review from supersven March 13, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants