WPB-26626: Parameterize conversation types over GroupConvType, add GroupConvTypeLegacy#5296
WPB-26626: Parameterize conversation types over GroupConvType, add GroupConvTypeLegacy#5296blackheaven wants to merge 11 commits into
Conversation
…oupConvTypeLegacy
fb1e82e to
1dc78db
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the Wire conversation API model to be parameterized over the group-conversation-type (gct), then concretizes most of the server/test surface to GroupConvType, while also introducing GroupConvTypeLegacy plus conversion helpers for backward-compatibility scenarios.
Changes:
- Parameterize
ConversationMetadata,OwnConversation,Conversation, and related response wrappers overgct, and propagateGroupConvTypethrough subsystem/store APIs. - Update Servant route types and a large set of integration/unit/golden tests to use the new
... GroupConvTypetypes. - Add
GroupConvTypeLegacywith conversion helpers (fromGroupConvTypeLegacy,toGroupConvTypeLegacy) and a changelog entry for WPB-26626.
Reviewed changes
Copilot reviewed 33 out of 35 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| services/galley/test/integration/API/Util.hs | Adjust integration test helpers to decode/compare OwnConversation/Conversation ... GroupConvType. |
| services/galley/test/integration/API/Teams.hs | Add explicit OwnConversation GroupConvType typing for decoded responses. |
| services/galley/test/integration/API/Roles.hs | Update decoded conversation types to Conversation GroupConvType. |
| services/galley/test/integration/API/MLS/Util.hs | Update MLS test helper to return Conversation GroupConvType. |
| services/galley/test/integration/API/MLS.hs | Update MLS integration test decoding to OwnConversation GroupConvType. |
| services/galley/test/integration/API/MessageTimer.hs | Disambiguate responseJsonUnsafe/Maybe decoding with OwnConversation GroupConvType annotations. |
| services/galley/test/integration/API/Federation.hs | Update federation integration tests to Conversation(s)Response GroupConvType and OwnConversation GroupConvType. |
| services/galley/test/integration/API.hs | Propagate GroupConvType through integration tests and response decoding. |
| libs/wire-subsystems/test/unit/Wire/StoredConversationSpec.hs | Update unit test generators/helpers to ... GroupConvType. |
| libs/wire-subsystems/src/Wire/StoredConversation.hs | Store/use ConversationMetadata GroupConvType and return Conversation/OwnConversation ... GroupConvType views. |
| libs/wire-subsystems/src/Wire/GalleyAPIAccess/Rpc.hs | Update RPC access layer return types to ... GroupConvType. |
| libs/wire-subsystems/src/Wire/GalleyAPIAccess.hs | Update effect GADT signatures to ... GroupConvType. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Util.hs | Update event mapping to return Public.OwnConversation GroupConvType. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Update.hs | Update update operations to return OwnConversation GroupConvType. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Query.hs | Update query operations to return Conversation/OwnConversation/... GroupConvType and related wrappers. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/One2One.hs | Update MLS 1-1 helpers to ... GroupConvType. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Conversation.hs | Update MLS conversation constructor to take ConversationMetadata GroupConvType. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Create.hs | Update creation responses to wrap Public.OwnConversation GroupConvType and related types. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem.hs | Update subsystem effect signatures to use ... GroupConvType. |
| libs/wire-subsystems/src/Wire/ConversationStore/Postgres.hs | Update metadata query to return ConversationMetadata GroupConvType. |
| libs/wire-subsystems/src/Wire/ConversationStore/MLS/Types.hs | Update MLS store types/field accessors to ConversationMetadata GroupConvType. |
| libs/wire-subsystems/src/Wire/ConversationStore/Cassandra.hs | Update Cassandra metadata query to return ConversationMetadata GroupConvType. |
| libs/wire-subsystems/src/Wire/ConversationStore.hs | Update store effect signature for metadata to ConversationMetadata GroupConvType. |
| libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs | Update roundtrip tests to use Conversation.* ... GroupConvType. |
| libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/CreateGroupConversation.hs | Update golden objects to CreateGroupOwnConversation GroupConvType. |
| libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/ConversationsResponse.hs | Update golden objects to ConversationsResponse GroupConvType. |
| libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ConversationList_20Conversation_user.hs | Update generated golden objects to ConversationList (OwnConversation GroupConvType). |
| libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Conversation_user.hs | Update generated golden OwnConversation objects to OwnConversation GroupConvType. |
| libs/wire-api/test/golden/Test/Wire/API/Golden/FromJSON.hs | Update FromJSON failure test to target OwnConversation GroupConvType. |
| libs/wire-api/src/Wire/API/Routes/Public/Galley/Conversation.hs | Parameterize conversation creation response unions over gct; pin most endpoints to GroupConvType. |
| libs/wire-api/src/Wire/API/Routes/Internal/Galley.hs | Pin internal conversation endpoints to ... GroupConvType. |
| libs/wire-api/src/Wire/API/Event/Conversation.hs | Pin EdConversation payload to OwnConversation GroupConvType. |
| libs/wire-api/src/Wire/API/Conversation.hs | Core refactor: parameterize conversation types over gct; add GroupConvTypeLegacy and conversion helpers. |
| libs/wire-api-federation/src/Wire/API/Federation/API/Galley.hs | Pin federation conversation metadata types to ConversationMetadata GroupConvType. |
| changelog.d/1-api-changes/WPB-26626 | Add changelog entry describing meeting conversation support/version expectations. |
|
The |
| domain = Domain "golden.example.com" | ||
|
|
||
| testObject_Conversation_user_1 :: OwnConversation | ||
| testObject_Conversation_user_1 :: OwnConversation GroupConvType |
There was a problem hiding this comment.
It would probably be good to run these golden tests with both types, showing that legacy is compatible.
supersven
left a comment
There was a problem hiding this comment.
ConversationMetadata usages look suspicious: They are always declared as ConversationMetadata GroupConvType. 🤔
- Reword changelog to reflect what this PR delivers (adding MeetingConversation); drop V16-gating/list-filtering claims (deferred to follow-up PR). - Add JSON roundtrip tests for GroupConvType and GroupConvTypeLegacy. - Add property test asserting fromGroupConvTypeLegacy/toGroupConvTypeLegacy are consistent inverses (covers the aligned-enums alignment request).
Yes, it'll be handle in upcoming PRs |
Mirror the existing GroupConvType roundtrip tests with GroupConvTypeLegacy counterparts for OwnConversation, Conversation, ConversationList and ConversationMetadata, exercising the legacy type through the parameterized JSON instances.
Hm, looks like I messed up the comment structure here. 😆 However, is it safe to deploy this PR without the follow-ups? I mean, what happens when we merge this one and before we get to the next ones, you catch a cold or something (i.e. aren't available to finish the,).... Would this be fine to go into production? 🤔 |
It will not break (further). BTW, the next PRs are: |
Propagate the GroupConvType type parameter to OwnConversation/Conversation usages that were missed when parameterizing the conversation types: - stern: getUserConversations (Stern.Intra) - brig: acceptLocalConnectConv/acceptConnectConv, guardConvAdmin - brig-integration: add type applications/annotations for responseJson* decoders in API.Provider, API.OAuth, API.User.Auth, API.User.Connection, API.User.Account and Federation.End2end.
https://wearezeta.atlassian.net/browse/WPB-26626
Checklist
changelog.d