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 scores set with unranked mods showing as processing indefinitely (again) #11151
Changes from 8 commits
ade9f0a
774ab79
97f41e3
fdfd5d1
e25f033
0cb8b4f
754463c
c5670f1
8239e94
3990207
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Models\Solo; | ||
|
||
use App\Models\Model; | ||
|
||
/** | ||
* @property int $score_id | ||
* @property int $processed_version | ||
* @property \Carbon\Carbon $processed_at | ||
*/ | ||
class ScoreProcessHistory extends Model | ||
{ | ||
protected $table = 'score_process_history'; | ||
|
||
public function score() | ||
{ | ||
return $this->belongsTo(Score::class, 'score_id'); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ class ScoreTransformer extends TransformerAbstract | |
// warning: the preload is actually for PlaylistItemUserHighScore, not for Score | ||
const MULTIPLAYER_BASE_PRELOAD = [ | ||
'scoreLink.score', | ||
'scoreLink.score.processHistory', | ||
'scoreLink.user.country', | ||
]; | ||
|
||
|
@@ -37,6 +38,7 @@ class ScoreTransformer extends TransformerAbstract | |
'beatmap.beatmapset', | ||
// it's for user profile so the user is already available | ||
// 'user', | ||
'processHistory', | ||
]; | ||
|
||
protected array $availableIncludes = [ | ||
|
@@ -102,6 +104,7 @@ public function transformSolo(MultiplayerScoreLink|ScoreModel|SoloScore $score) | |
if ($score instanceof SoloScore) { | ||
$extraAttributes['ranked'] = $score->ranked; | ||
$extraAttributes['preserve'] = $score->preserve; | ||
$extraAttributes['processed'] = $score->legacy_score_id !== null || $score->processHistory !== null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uhhh... So earlier I said:
So as it turns out, I lied here (or if you wanna be charitable, "forgot"). It is not always the case that a The exception is scores that have been initially manually batch-imported from I can't exactly double-check production to confirm this but I realised this when testing on my local database wherein I had a local score import from seeded What this says about this particular PR, and also the complexity in and around the new score table, I'm not entirely sure, but I do acknowledge that it's pretty bad, but also don't really have anything constructive to offer that isn't like a week spent on revisiting the entirety of the table structure again and attempting to somehow beat it into shape better... |
||
} | ||
|
||
$hasReplay = $score->has_replay; | ||
|
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.
Should be above the comment.