-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor conversation actions to enable dedicated effect sets for eac…
…h action (#2173) Use a tagged existential type and a type family to provide a dedicated list of effects for each conversation action. Previously, actions were represented by a sum type. The replacement is a (logical) pair of a tag and an accompanying action type. Co-authored-by: Sven Tennie <[email protected]> Co-authored-by: Paolo Capriotti <[email protected]>
- Loading branch information
1 parent
f37e36f
commit 2209bfa
Showing
21 changed files
with
835 additions
and
573 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
changelog.d/6-federation/refactor-federated-conversation-actions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Refactor conversation actions to an existential type consisting of a singleton | ||
tag (identifying the action) and a dedicated type for the action itself. | ||
Previously, actions were represented by a big sum type. The new approach | ||
enables us to describe the needed effects of an action much more precisely. | ||
The existential type is initialized by the Servant endpoints in a way to | ||
mimic the previous behavior. However, the messages between services changed. | ||
Thus, all federated backends need to run the same (new) version. The | ||
deployment order itself does not matter. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 16 additions & 14 deletions
30
libs/wire-api-federation/test/golden/testObject_ConversationUpdate2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
{ | ||
"orig_user_id": { | ||
"domain": "golden.example.com", | ||
"id": "00000000-0000-0000-0000-000100000007" | ||
"cuAction": { | ||
"action": { | ||
"users": [ | ||
{ | ||
"domain": "golden.example.com", | ||
"id": "00000000-0000-0000-0000-000100004007" | ||
} | ||
] | ||
}, | ||
"tag": "ConversationLeaveTag" | ||
}, | ||
"already_present_users": [ | ||
"cuAlreadyPresentUsers": [ | ||
"00000fff-0000-0000-0000-000100005007", | ||
"00000fff-0000-aaaa-0000-000100005007" | ||
], | ||
"time": "1864-04-12T12:22:43.673Z", | ||
"action": { | ||
"tag": "ConversationActionRemoveMembers", | ||
"contents": [ | ||
{ | ||
"domain": "golden.example.com", | ||
"id": "00000000-0000-0000-0000-000100004007" | ||
} | ||
] | ||
"cuConvId": "00000000-0000-0000-0000-000100000006", | ||
"cuOrigUserId": { | ||
"domain": "golden.example.com", | ||
"id": "00000000-0000-0000-0000-000100000007" | ||
}, | ||
"conv_id": "00000000-0000-0000-0000-000100000006" | ||
"cuTime": "1864-04-12T12:22:43.673Z" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.