Skip to content

fix: no clarfication on team dashboard #2600

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

Closed
wants to merge 1 commit into from

Conversation

cubercsl
Copy link
Contributor

No description provided.

@cubercsl cubercsl changed the title fix: no clearfication on team dashboard fix: no clarfication on team dashboard Jun 16, 2024
@vmcj
Copy link
Member

vmcj commented Jun 16, 2024

@cubercsl for what type of clarifications was this a fix?

@cubercsl
Copy link
Contributor Author

Clarification associates either problem or contest. The existing code selects contestproblem and contest, which selects nothing :(. So team will see nothing on their team home, but if they enable notification, they can click it and jump to the clarification URL and see its content.

@cubercsl
Copy link
Contributor Author

This is our hotfix between warmup and contest, but this may not occur in demoweb, I will verify this later.

@vmcj
Copy link
Member

vmcj commented Jun 16, 2024

Clarification associates either problem or contest. The existing code selects contestproblem and contest, which selects nothing :(. So team will see nothing on their team home, but if they enable notification, they can click it and jump to the clarification URL and see its content.

From a quick glance at the code I would assume the LeftJoin would already have to do this. The only reason for not merging this would be the speed penalty though so let's see if we can reproduce this somewhere and I'll take a look later this week.

@cubercsl
Copy link
Contributor Author

cubercsl commented Jun 16, 2024

@vmcj I have repro this on demoweb, pls check it. Both clarification and clarification requests (not reference
to a problem) can not be seen in the team home, but when you login as team, you can open the clarification by url https://www.domjudge.org/demoweb/team/clarifications/193

@cubercsl cubercsl marked this pull request as draft June 16, 2024 11:10
Co-authored-by: Soha Jin <soha@jin.sh>
@cubercsl cubercsl marked this pull request as ready for review June 16, 2024 11:17
Copy link
Member

@vmcj vmcj left a comment

Choose a reason for hiding this comment

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

I'll give the rest a bit of time to look at it but I agree its broken.

@@ -103,8 +103,7 @@ public function homeAction(Request $request): Response
->leftJoin('c.sender', 's')
->leftJoin('c.recipient', 'r')
->select('c', 'cp', 'p')
->andWhere('c.contest = :contest')
->andWhere('cp.contest = :contest')
->andWhere('c.contest = :contest OR cp.contest = :contest')
Copy link
Member

Choose a reason for hiding this comment

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

General question about the existing code:
When would ever cp.contest match $contest, but c.contest not? That is, why can't we just have

->andWhere('c.contest = :contest')

Copy link
Member

Choose a reason for hiding this comment

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

When you unlink a problem from a contest is the only way I can think of.

Copy link
Contributor

Choose a reason for hiding this comment

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

this was implemented in 0219d8e

@cubercsl
Copy link
Contributor Author

cubercsl commented Jun 16, 2024

@Dup4 told me that the clarifications (send to all, with specific problem) can be displayed correctly on the team homepage in his shadow (of my instance). The picture below is his screenshot in shadow (login with DOMJudge team member)
Image_1718581382419
But the general issue and technical issue (i.e. without specific problem) can not be shown.

@moesoha
Copy link
Contributor

moesoha commented Jun 17, 2024

I found that we misunderstood the motivation of the ->andWhere('cp.contest = :contest') after ->andWhere('c.contest = :contest'), so this PR is not good.

At first, I think ->andWhere('cp.contest = :contest') is used to support a problem in multiple contests (like one problem exists in Div.1 and Div.2). By this way, clarification can be decoupled with contests, and can be associated with either Contest or Problem. And a clarification associated with a problem can be synced to all contests.

But since I investigated the codes today, I found the commit implements above codes: 0219d8e. This code fixes the issue mentioned in #2279, but I don't think this is a solution. Obviously, @vmcj misunderstood the usage of LEFT JOIN, and the fix for this issue is actually an accident. I'd like to draft a new PR to fix #2279 again.

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.

5 participants