Record the SQLite APPLY fix for leaderboard endpoints

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-08 19:34:12 -08:00
co-authored by Claude Opus 5.5
parent f7567c4c4f
commit abf5d69d6f
+9 -9
View File
@@ -543,7 +543,7 @@ loads, and `GET /player/76561199407393962` returns 404 rather than 500.
### Phase 3: Importer ### Phase 3: Importer
**Importer done 2026-11-09** (`pleb/main` at `737575b`, not pushed yet). Usage **Importer done 2026-11-09** (`pleb/main` at `e3f991c`, pushed to Gitea). Usage
and the full file → table mapping are in the fork's `MIRROR.md`. A full import and the full file → table mapping are in the fork's `MIRROR.md`. A full import
takes about 11 s, and an unchanged rerun writes 0 rows. What differs from the takes about 11 s, and an unchanged rerun writes 0 rows. What differs from the
steps below: steps below:
@@ -580,14 +580,14 @@ archived upstream responses, on a scratch DB with `ASPNETCORE_ENVIRONMENT=Mirror
triangle ratings. triangle ratings.
- `/accgraph` and `/history/triangle` match. `/score/statistic/{id}` redirects - `/accgraph` and `/history/triangle` match. `/score/statistic/{id}` redirects
to the local file. to the local file.
- **Open: `/leaderboard/{id}` and `/leaderboard/scores/{id}` return 500.** - `/leaderboard/{id}` and `/leaderboard/scores/{id}` first returned 500.
`LeaderboardController.GeneralScores` projects About 10 projections order `Player.Clans` by an expression over the outer
`Player.Clans.OrderBy(…ClanOrder…).Take(1)`, which needs SQL `APPLY`, and row's `ClanOrder`, which needs SQL `APPLY`, and SQLite has none. **Fixed**
SQLite has none. The same pattern appears about 8 times, in in `e3f991c`: `Utils/MirrorQueryInterceptor.cs`, an EF query interceptor
`ScoreController`, `ReplayController`, `LeaderboardController` and registered only in MirrorMode, rewrites any ordering of `Player.Clans` to
`ClanUtils`. Fix it in a separate server commit before phase 4. For example, ordering by clan id. One file instead of patching every call site; the
skip the clan projection in MirrorMode (there are no clans), or move the mirror has no clans, so the order doesn't matter. The leaderboard,
ordering client-side. clan-ranking and context variants now return 200.
The check below (stock website) is still to do in phase 4. The check below (stock website) is still to do in phase 4.