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

Use hash rather than online ID as primary lookup key when presenting score #28171

Merged
merged 2 commits into from
May 14, 2024

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented May 14, 2024

Something I ran into when investigating #28169.

If there are two scores with the same online ID available in the database - for instance, one being recorded locally, and one recorded by spectator server, of one single play - the lookup code would use online ID first to find the score and pick any first one that matched. This could lead to the wrong replay being refetched and presented / exported.

(In the case of the aforementioned issue, I was confused as to why after restarting spectator server midway through a play and importing the replay saved by spectator server after the restart, I was seeing a complete replay with no dropped frames, even though there was nothing in the code that prevented the frame drop. It turns out that I was getting
presented the locally recorded replay instead all along.)

Instead, jiggle the fallback preference to use hash first.


If inclined to test this manually, here's a pair of replays that should demonstrate the issue: example-replays.zip

One should have cursor movement start-to-end (client-side recording), one should have no movement for the first half a minute or so and then resume playback after (server-side recording after a restart)

bdach added 2 commits May 14, 2024 11:13
…score

Something I ran into when investigating
ppy#28169.

If there are two scores with the same online ID available in the
database - for instance, one being recorded locally, and one recorded by
spectator server, of one single play - the lookup code would use online
ID first to find the score and pick any first one that matched. This
could lead to the wrong replay being refetched and presented / exported.

(In the case of the aforementioned issue, I was confused as to whether
after restarting spectator server midway through a play and importing
the replay saved by spectator server after the restart, I was seeing a
complete replay with no dropped frames, even though there was nothing in
the code that prevented the frame drop. It turns out that I was getting
presented the locally recorded replay instead all along.)

Instead, jiggle the fallback preference to use hash first.
@peppy peppy merged commit c31b503 into ppy:master May 14, 2024
15 of 17 checks passed
@bdach bdach deleted the present-score-different-hashes branch May 14, 2024 15:48
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.

2 participants