-
Notifications
You must be signed in to change notification settings - Fork 4
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
RES-1910 Event chat and attendee count inconsistencies #668
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of questions about the logic of who is set as a host of an event when joining the event.
$u = User::find($user); | ||
|
||
// A host of a group who is added to an event becomes a host of the event. | ||
$eventRole = $u && $u->role == Role::RESTARTER ? Role::RESTARTER : Role::HOST; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would make network coordinators and admins hosts of the event, too, right?
I can think of cases where that's not going to match reality (e.g. me, going to an event). But, probably generally fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the case where a host of one group attends an event by another group, this would automatically make them host of that event? I don't think that should be the case. It should only turn hosts of the event's group into hosts of the event, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second point would also fix the first. This logic isn't well-tested in any case, so I've added a test for it to check that people are/aren't added as hosts appropriately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the logic for setting event role needs changing, see comment.
$u = User::find($user); | ||
|
||
// A host of the group who is added to an event becomes a host of the event. | ||
$eventRole = $u && $u->role == Role::HOST && Fixometer::userIsHostOfGroup($party->group, $user) ? Role::HOST : Role::RESTARTER; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should just be
$eventRole = $u && Fixometer::userIsHostOfGroup($party->group, $user) ? Role::HOST : Role::RESTARTER;
as there could be admins or network coordinators who are host of the group, and should get set with $eventRole = Role::HOST, even if their overall role ($u->role) might not be Role::HOST.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I've made that change.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Based on RES-1855 so the diffs are confusing until that is merged.
DiscourseService
to remove a user from the private message thread.