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

Fix: Connection type when unblocking after LH #1549

Merged
merged 15 commits into from
May 30, 2021
Merged

Fix: Connection type when unblocking after LH #1549

merged 15 commits into from
May 30, 2021

Conversation

fisx
Copy link
Contributor

@fisx fisx commented May 29, 2021

See haddocks for RelationWithHistory for more info. Fixes a bug introduced here that can only be triggered if legalhold is enabled (not the default).

@fisx fisx requested a review from smatting May 29, 2021 18:49
fisx and others added 5 commits May 29, 2021 21:43
The redundant test case was hitting an execution path that was not hit
before because I was reluctant to call the test with all combinations
of options.  I'll know better next time, I hope...
Connect convs do not contain the other user, so in order to find the
other user it's not good to go through that.
@fisx fisx changed the title Fix: Connection type when unblocking after LH Fix: Connection type when unblocking after LH [skip ci] May 30, 2021
@fisx fisx changed the title Fix: Connection type when unblocking after LH [skip ci] Fix: Connection type when unblocking after LH May 30, 2021
@fisx fisx merged commit 076f07b into develop May 30, 2021
@fisx fisx deleted the fix-relations branch May 30, 2021 09:20
fisx added a commit that referenced this pull request May 30, 2021
(Copied from #1507, which
has meanwhile been reverted in
#1549.)
fisx added a commit that referenced this pull request May 30, 2021
(Copied from #1507, which
has meanwhile been reverted in
#1549.)
smatting pushed a commit that referenced this pull request May 30, 2021
(Copied from #1507, which
has meanwhile been reverted in
#1549.)
@fisx fisx mentioned this pull request May 31, 2021
fisx added a commit that referenced this pull request May 31, 2021
(Copied from #1507, which
has meanwhile been reverted in
#1549.)
smatting pushed a commit that referenced this pull request Jun 9, 2021
(Copied from #1507, which
has meanwhile been reverted in
#1549.)
fisx added a commit that referenced this pull request Jun 23, 2021
* Import removeTeam to Galley.API.LegalHold without import cycles.

(will be needed shortly.)

* iterateConversations.

(Copied from #1507, which
has meanwhile been reverted in
#1549.)

* Make removeMember device id argument optional.

* handleGroupConvPolicyConflicts [wip]

* test stub

* mapcon

* fix bug in handleGroupConvPolicyConflicts

* add 2 test cases: who is admin? who gets removed?

* Add group conv logic [wip]

* move lh helpers to utils

* fixup add members

* fixup tests

* use Conversation from galley to include self

* implement anyLHConsentMissing

* Move check*Event funs from Teams to Utils

* update first

* adjust test to new setting & adjust case when peer is admin

* hi ci

* Add checks for leave events

* add testNoConsentCannotBeInvited

* add failing test case

* Add guards (test succeeds)

* refactor: rename guard functions

* comment wording

* anyLegalholdActivated: make true to the name

* adjust testNoConsentRemoveFromGroupConv

* inviting conflicting users: adjust and rename test

* remove futurework (wont do) and add comments

* remove test marker

* spell out the tests

* add FUTUREWORKs for test structure

* comment wording

* add test for v2 endpoint

* add additional safeguard

* Cleanup.

* Add two missing test case stubs.

* Eliminate redundant negation in function name.

* Boolean blindness.

only the first line changed, rest is ormolu noise.

* Fix call side.

* Changed my mind about whether boolean blindness is a good thing.

* Fixup.

* Cleanup (move source comment to inner block).

* Tweak detail.

* Remove dubious claim.

#1595 (comment)

* Simplify.

* Move code around.

* LH consent: guarantee that all conflicting conv members are removed.

* Taking back e16a0bc.

(I thought I had spotted a difference in database load, but I think i
was wrong, and the original code is more straight-forward.)

* Fixup.

* Change test cases & descriptions.

* fix syntax

* All -> Some (explanation in message)

Why
1) Because "Some" is the negation of "None"
2) This is consistent with testGroup "Legalhold is activated for user A in a group conversation"

* add failing test case

* Refactor: factor out new fn getLHStatusForUsers

* Update business logic

* Remove NoConsentingAdmins test case

* Add test case: mixed invitees

* Refactor: group tests regarding invite together

* assertion

(it's non-trivial, but easy enough to convince ourselves that it'll
pass fine, so no error handling needed.)

* Language.

Co-authored-by: Matthias Fischmann <mf@zerobuzz.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants