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 judgement counter not showing correct counts when spectating user mid-play #29914

Merged
merged 5 commits into from
Sep 27, 2024

Conversation

peppy
Copy link
Member

@peppy peppy commented Sep 18, 2024

Closes #29874

Test setup is ugly because the flow is ugly.

bdach
bdach previously requested changes Sep 18, 2024
Comment on lines 64 to 77
// This flow is made to handle cases of watching from the middle of a replay / spectating session.
//
// Once we get an initial state, we can rely on `NewJudgement` and `JudgementReverted`, so
// as a preemptive optimisation, only do a full re-sync if we have all-zero counts.
bool hasCounts = false;

foreach (var r in results)
{
if (r.Value.ResultCount.Value > 0)
{
hasCounts = true;
break;
}
}
Copy link
Collaborator

@bdach bdach Sep 18, 2024

Choose a reason for hiding this comment

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

In testing on production, it appears that this breaks the PR, because it appears that the resets-from-replay-frame occur at the end of a frame bundle, at which point part of gameplay has been replayed and very likely incurred an actual judgement through the expected flows.

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 applied a simple fix which looks good on paper and seems to work in initial testing. There's a brief period where counts won't be updated (until the first reset event) but I think this is okay.

@pull-request-size pull-request-size bot added size/M and removed size/L labels Sep 19, 2024
@bdach bdach dismissed their stale review September 19, 2024 14:18

blocker resolved

@bdach bdach merged commit a00ed8d into ppy:master Sep 27, 2024
7 of 9 checks passed
@peppy peppy deleted the fix-judgement-counter-sync branch September 30, 2024 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Judgement counts while spectating start at 0
2 participants