Skip to content
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

Improve global team conversation handling and self conversation creation error. #2862

Merged
merged 7 commits into from
Nov 28, 2022

Conversation

elland
Copy link
Contributor

@elland elland commented Nov 23, 2022

Removed global team conversation creator, improved tests, improve adding users.
Improves error thrown when creating the self conversation, 500 bad.

@elland elland temporarily deployed to cachix November 23, 2022 11:01 Inactive
@elland elland temporarily deployed to cachix November 23, 2022 11:01 Inactive
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Nov 23, 2022
@elland elland temporarily deployed to cachix November 24, 2022 09:13 Inactive
@elland elland temporarily deployed to cachix November 24, 2022 09:13 Inactive
@elland elland temporarily deployed to cachix November 24, 2022 11:00 Inactive
@elland elland temporarily deployed to cachix November 24, 2022 11:00 Inactive
E.getUserTeams (tUnqualified lusr) >>= \tids ->
runError @InternalError $
runError @(Tagged 'NotATeamMember ())
(for_ tids $ \tid -> getGlobalTeamConversation lusr tid)
Copy link
Member

Choose a reason for hiding this comment

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

Why leave a side effect in listing conversations; which, as a sideeffect of getting global team conversations, creates one?

Why not create the global team conversation during the creation of a team?

And if you'd like to enable this functionality for existing teams, you could add a one-off data migration as done in https://github.com/wireapp/wire-server/tree/develop/services/galley/migrate-data/src - read the list of teams, insert one record into conversations, and from then on all teams will have this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would also be possible to use the approach you suggest, but after some discussion with other backend people, I'm not sure it's really worth it.

Ultimately, the "side effect" of creating the global team conversation is not really a side effect, since it's not observable from the outside. The small extra lookup needed when listing conversations doesn't seem like a huge problem, considering that listing conversations is already a slow operation.

On the other hand, preemptively creating all GTCs (and for consistency, all MLS self conversations) forces the creation of all these extra conversations for inactive teams and users. I admit that this is probably not a big concern.

Therefore, we decided to stick with the current approach for now. I'm happy to discuss this further if you still think it's a mistake.

@elland elland temporarily deployed to cachix November 24, 2022 13:12 Inactive
@elland elland temporarily deployed to cachix November 24, 2022 13:12 Inactive
@elland elland temporarily deployed to cachix November 24, 2022 15:23 Inactive
@elland elland temporarily deployed to cachix November 24, 2022 15:23 Inactive
@elland elland force-pushed the elland/global-team-conv-refine branch from 6992bbf to 81fb3f8 Compare November 28, 2022 08:58
@elland elland temporarily deployed to cachix November 28, 2022 08:58 Inactive
@elland elland temporarily deployed to cachix November 28, 2022 08:58 Inactive
@elland elland requested a review from smatting November 28, 2022 09:29
convMetadata =
ConversationMetadata
{ cnvmType = GlobalTeamConv,
-- FUTUREWORK: Make this a qualified user ID.
Copy link
Contributor

Choose a reason for hiding this comment

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

That FUTUREWORK is proably better placed at the definition of ConversationMetadata

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is already there. Copy paste remnants :)

Copy link
Contributor

@smatting smatting left a comment

Choose a reason for hiding this comment

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

LGTM safe for my comments

@elland elland temporarily deployed to cachix November 28, 2022 11:01 Inactive
@elland elland temporarily deployed to cachix November 28, 2022 11:01 Inactive
@elland elland changed the title Improve global team conversation handling Improve global team conversation handling and self conversation creation error. Nov 28, 2022
@elland elland merged commit 381bf7b into develop Nov 28, 2022
@elland elland deleted the elland/global-team-conv-refine branch November 28, 2022 14:03
@smatting smatting restored the elland/global-team-conv-refine branch November 28, 2022 15:47
smatting added a commit that referenced this pull request Nov 28, 2022
smatting added a commit that referenced this pull request Dec 9, 2022
@smatting smatting mentioned this pull request Dec 9, 2022
1 task
smatting added a commit that referenced this pull request Dec 9, 2022
* Revert "[FS-1267] Patch issue with initial commit bundle throwing a global team conversation error (#2887)"

This reverts commit 1cc2bd2.

* Revert "Commented out GTC for release. (#2879)"

This reverts commit 49da310.

* Revert "Improve global team conversation handling and self conversation creation error. (#2862)"

This reverts commit 381bf7b.

* Revert "[FS-926] Create new conversation type for global team conversation (#2753)"

This reverts commit c4c9ea2.
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.

None yet

5 participants