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

Deleted participants stay present in meeting #2730

Merged

Conversation

hjanott
Copy link
Member

@hjanott hjanott commented Nov 18, 2024

Closes #2729

@hjanott hjanott added the bug label Nov 18, 2024
@hjanott hjanott added this to the 4.2 milestone Nov 18, 2024
@hjanott hjanott self-assigned this Nov 18, 2024
@hjanott hjanott assigned rrenkert and unassigned hjanott Nov 19, 2024
@hjanott hjanott marked this pull request as ready for review November 19, 2024 14:28
@hjanott hjanott requested a review from reiterl November 20, 2024 08:45
Copy link
Member

@reiterl reiterl left a comment

Choose a reason for hiding this comment

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

I found some stuff in this pr. Please fix it.

Comment on lines 143 to 144
def check_meeting_and_users(
self, instance: dict[str, Any], user_fqid: FullQualifiedId
Copy link
Member

Choose a reason for hiding this comment

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

As far as I looked at the source code check_meeting_and_users is called every time if a user action with the mixin is called. I think, you want to call a presence cleaning only if the user is removed from an meeting or deleted.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've found that at the same condition the 'ConditionalSpeakerCascadeMixin' is executing its 'update_instance'. So I moved it there. I propose to rename this mixin to 'ConditionalMeetingUserCascadeMixin'

Comment on lines 153 to 155
"meeting_id": meeting_id,
"present": False,
}
Copy link
Member

Choose a reason for hiding this comment

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

Does this handle the case, if a user is deleted and presence in two meetings?

Copy link
Member Author

Choose a reason for hiding this comment

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

Now in its new place it does. :)

Comment on lines 11 to 12
This migration adds the user_id "-1" to all existing action_workers.
This is the number usually used for calls using the internal route.
Copy link
Member

Choose a reason for hiding this comment

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

user_id -1 is not an Id and will lead to errors. Why use such an id?

Copy link
Member Author

Choose a reason for hiding this comment

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

Wrote the actual description.

Comment on lines 20 to 25
meetings = self.reader.get_all(
"meeting", ["group_ids", "present_user_ids", "meeting_user_ids"]
)
users = self.reader.get_all(
"user", ["is_present_in_meeting_ids", "meeting_user_ids"]
)
Copy link
Member

Choose a reason for hiding this comment

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

Ui, that is a large operation, getting 1000+ meetings and 10000+ users in worse case. Use get_all with cautious
and use filter, etc instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about this but I couldn't think of a solution, because I have to compare in both directions if the presence relation between the meeting and user is corrupted. If only one way was necessary I could at least filter for all the users that are present in meetings.

Copy link
Member Author

Choose a reason for hiding this comment

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

Due to refactoring this does not exist anymore. Now I'm using one filter for the meeting users and get_many for meeting and users.

"user", ["is_present_in_meeting_ids", "meeting_user_ids"]
)

def helper() -> None:
Copy link
Member

Choose a reason for hiding this comment

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

helper is a bad name.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Due to refactoring this function does not exist anymore.


def helper() -> None:
if not (
(meeting_user_ids := user.get("meeting_user_ids", []))
Copy link
Member

Choose a reason for hiding this comment

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

Where does helper get his user from?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added arguments. Before the nested function would use all local variables in the enclosing scope.

Copy link
Member Author

Choose a reason for hiding this comment

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

Due to refactoring this function does not exist anymore.

Comment on lines 58 to 62
for lookup, cross_lookup, what_collection, field in [
(meetings, present_users_per_meeting, "meeting", "present_user_ids"),
(users, meetings_per_present_user, "user", "is_present_in_meeting_ids"),
]
for what_id, which_ids in cross_lookup.items()
Copy link
Member

Choose a reason for hiding this comment

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

Better to use two loops here. This code no one understands, is bogus.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@reiterl reiterl assigned hjanott and unassigned reiterl Nov 20, 2024
@hjanott hjanott requested a review from reiterl November 22, 2024 08:58
@hjanott hjanott assigned reiterl and unassigned hjanott Nov 22, 2024
Copy link
Member

@reiterl reiterl left a comment

Choose a reason for hiding this comment

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

It looks okay.

@reiterl reiterl removed their assignment Nov 25, 2024
@rrenkert rrenkert assigned hjanott and unassigned rrenkert Nov 25, 2024
@hjanott hjanott enabled auto-merge (squash) November 25, 2024 14:03
@hjanott hjanott merged commit 1bdd315 into OpenSlides:main Nov 25, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removed users stay present in meeting
3 participants