From 1ddb3318fa72e77203785db69043916940ecdbf9 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Mon, 10 Jan 2022 09:33:34 +0000 Subject: [PATCH 1/8] bump version --- server/package.json | 2 +- server/src/lib/constants/version.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/package.json b/server/package.json index 0ec8ff8de..f72a29ce0 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "tachi-server", - "version": "2.0.29", + "version": "2.0.30", "description": "A score tracking server.", "main": "js/index.js", "private": true, diff --git a/server/src/lib/constants/version.ts b/server/src/lib/constants/version.ts index 798c84e88..7b9679f72 100644 --- a/server/src/lib/constants/version.ts +++ b/server/src/lib/constants/version.ts @@ -4,7 +4,7 @@ const MAJOR = 2; const MINOR = 0; -const PATCH = 29; +const PATCH = 30; // As is with all front-facing zkldi projects, the version names for tachi-server // are from an album I like. In this case, the album is Portishead - Dummy. From 46700da57276c1986aea40aa780cd017de2efed1 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Mon, 10 Jan 2022 09:56:58 +0000 Subject: [PATCH 2/8] Fix regression with "unit" testing (haha) --- server/src/lib/score-mutation/update-score.test.ts | 5 +++++ server/src/lib/score-mutation/update-score.ts | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/server/src/lib/score-mutation/update-score.test.ts b/server/src/lib/score-mutation/update-score.test.ts index ba8d96d67..9bd67add8 100644 --- a/server/src/lib/score-mutation/update-score.test.ts +++ b/server/src/lib/score-mutation/update-score.test.ts @@ -6,6 +6,7 @@ import db from "external/mongo/db"; import UpdateScore from "./update-score"; import { CreateScoreID } from "lib/score-import/framework/score-importing/score-id"; import ResetDBState from "test-utils/resets"; +import { rootLogger } from "lib/logger/logger"; const mockImportDocument: ImportDocument = { userID: 1, @@ -61,8 +62,12 @@ t.test("#UpdateScore", (t) => { scoreData: { score: 1020 }, } as any); + delete score._id; + const newScoreID = CreateScoreID(score.userID, score, score.chartID); + rootLogger.crit(newScoreID); + await db.imports.insert(mockImportDocument); await db.sessions.insert(mockSessionDocument); diff --git a/server/src/lib/score-mutation/update-score.ts b/server/src/lib/score-mutation/update-score.ts index f2f0f4f0c..ba956e5b5 100644 --- a/server/src/lib/score-mutation/update-score.ts +++ b/server/src/lib/score-mutation/update-score.ts @@ -4,6 +4,7 @@ import { KtLogger, rootLogger } from "lib/logger/logger"; import { CreateCalculatedData } from "lib/score-import/framework/calculated-data/calculated-data"; import { UpdateChartRanking } from "lib/score-import/framework/pb/create-pb-doc"; import { CreateScoreID } from "lib/score-import/framework/score-importing/score-id"; +import { id } from "monk"; import { ScoreDocument } from "tachi-common"; import { UpdateAllPBs } from "utils/calculations/recalc-scores"; import { FormatUserDoc, GetUserWithID } from "utils/user"; @@ -67,6 +68,15 @@ export default async function UpdateScore(oldScore: ScoreDocument, newScore: Sco ); try { + // Having _id defined will cause this to throw, causing it to not apply + // the update. + if (newScore._id) { + logger.warn( + `Passed a score with _id to UpdateScore. This property should not be set. Deleting this property and continuing anyway.` + ); + // This property shouldn't be defined. + delete newScore._id; + } await db.scores.update( { scoreID: oldScoreID, From 98f6e49a4a2be3238d7181a6ce55b5088d16a1cd Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Tue, 11 Jan 2022 13:24:04 +0000 Subject: [PATCH 3/8] Bump version --- server/package.json | 2 +- server/src/lib/constants/version.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/package.json b/server/package.json index f72a29ce0..0553c20b4 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "tachi-server", - "version": "2.0.30", + "version": "2.0.31", "description": "A score tracking server.", "main": "js/index.js", "private": true, diff --git a/server/src/lib/constants/version.ts b/server/src/lib/constants/version.ts index 7b9679f72..a514eccae 100644 --- a/server/src/lib/constants/version.ts +++ b/server/src/lib/constants/version.ts @@ -4,7 +4,7 @@ const MAJOR = 2; const MINOR = 0; -const PATCH = 30; +const PATCH = 31; // As is with all front-facing zkldi projects, the version names for tachi-server // are from an album I like. In this case, the album is Portishead - Dummy. From b9f15bf3da2604b0261ca83ce5944548911dc349 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Tue, 11 Jan 2022 13:24:52 +0000 Subject: [PATCH 4/8] Fix faulty assumption in lr2hook. --- .../src/lib/score-import/import-types/ir/lr2hook/converter.ts | 2 +- server/src/lib/score-import/import-types/ir/lr2hook/parser.ts | 2 +- server/src/lib/score-import/import-types/ir/lr2hook/types.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/lib/score-import/import-types/ir/lr2hook/converter.ts b/server/src/lib/score-import/import-types/ir/lr2hook/converter.ts index 45a454673..f710cea1f 100644 --- a/server/src/lib/score-import/import-types/ir/lr2hook/converter.ts +++ b/server/src/lib/score-import/import-types/ir/lr2hook/converter.ts @@ -91,7 +91,7 @@ function ConvertRandom( random: LR2HookScore["playerData"]["random"] ): ScoreDocument<"bms:7K">["scoreMeta"]["random"] { switch (random) { - case "NONRAN": + case "NORAN": return "NONRAN"; case "MIRROR": return "MIRROR"; diff --git a/server/src/lib/score-import/import-types/ir/lr2hook/parser.ts b/server/src/lib/score-import/import-types/ir/lr2hook/parser.ts index 9d42f4e83..9649e2830 100644 --- a/server/src/lib/score-import/import-types/ir/lr2hook/parser.ts +++ b/server/src/lib/score-import/import-types/ir/lr2hook/parser.ts @@ -5,7 +5,7 @@ import p, { PrudenceSchema } from "prudence"; import ScoreImportFatalError from "lib/score-import/framework/score-importing/score-import-error"; import { FormatPrError } from "utils/prudence"; -const SUPPORTED_RANDOMS = ["NONRAN", "MIRROR", "RAN", "S-RAN"]; +const SUPPORTED_RANDOMS = ["NORAN", "MIRROR", "RAN", "S-RAN"]; const PR_LR2Hook: PrudenceSchema = { md5: "string", diff --git a/server/src/lib/score-import/import-types/ir/lr2hook/types.ts b/server/src/lib/score-import/import-types/ir/lr2hook/types.ts index edcf99825..4be600234 100644 --- a/server/src/lib/score-import/import-types/ir/lr2hook/types.ts +++ b/server/src/lib/score-import/import-types/ir/lr2hook/types.ts @@ -5,7 +5,7 @@ export interface LR2HookScore { playerData: { autoScr: 0; gameMode: unknown; - random: "NONRAN" | "MIRROR" | "RAN" | "S-RAN"; + random: "NORAN" | "MIRROR" | "RAN" | "S-RAN"; gauge: "GROOVE" | "HAZARD" | "HARD" | "EASY" | "P-ATTACK" | "G-ATTACK"; }; scoreData: { From b172e1efb012413673d97a900a0a0e7a9e562ba0 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Fri, 14 Jan 2022 13:32:54 +0000 Subject: [PATCH 5/8] Enable 0.8.4 as a valid lr2oraja client. --- server/src/lib/score-import/import-types/ir/beatoraja/parser.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts b/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts index 7ca9671c5..dc3f9a3a9 100644 --- a/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts +++ b/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts @@ -64,10 +64,12 @@ const PR_BeatorajaChart = { }; const SUPPORTED_BEATORAJA_CLIENTS = [ + "LR2oraja 0.8.4", "LR2oraja 0.8.3", "LR2oraja 0.8.2", "LR2oraja 0.8.1", "LR2oraja 0.8.0", + "LR2oraja(rekidai.info) 0.8.4", "LR2oraja(rekidai.info) 0.8.3", "LR2oraja(rekidai.info) 0.8.2", "LR2oraja(rekidai.info) 0.8.1", From f1915e94c3f3e4f4c3f7da7578b5acdef30aa25b Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Tue, 18 Jan 2022 10:01:28 +0000 Subject: [PATCH 6/8] Add proper indexing for charts-iidx. --- server/src/external/mongo/indexes.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/server/src/external/mongo/indexes.ts b/server/src/external/mongo/indexes.ts index c2b7823bf..9e7841440 100644 --- a/server/src/external/mongo/indexes.ts +++ b/server/src/external/mongo/indexes.ts @@ -63,13 +63,7 @@ const staticIndexes: Partial> = { index({ title: "text", searchTerms: "text" }), ], "kai-auth-tokens": [index({ userID: 1, service: 1 }, UNIQUE)], - "charts-iidx": [ - index( - { "data.arcChartID": 1 }, - { unique: true, partialFilterExpression: { "data.arcChartID": { $type: "string" } } } - ), - index({ "data.hashSHA256": 1 }), - ], + "bms-course-lookup": [index({ md5sums: 1 }, UNIQUE)], "api-tokens": [index({ token: 1 }, UNIQUE), index({ userID: 1 })], tables: [index({ tableID: 1, game: 1, playtype: 1 }, UNIQUE)], @@ -84,6 +78,14 @@ const staticIndexes: Partial> = { counters: [index({ counterName: 1 }, UNIQUE)], "class-achievements": [index({ game: 1, playtype: 1, timeAchieved: 1 })], "api-clients": [index({ clientID: 1 }, UNIQUE)], + "charts-iidx": [ + index( + { "data.arcChartID": 1 }, + { unique: true, partialFilterExpression: { "data.arcChartID": { $type: "string" } } } + ), + index({ "data.hashSHA256": 1 }), + index({ "data.inGameID": 1, playtype: 1, difficulty: 1 }), + ], "charts-bms": [index({ "data.hashMD5": 1 }, UNIQUE), index({ "data.hashSHA256": 1 }, UNIQUE)], "charts-popn": [index({ "data.hashSHA256": 1 }, UNIQUE)], "charts-sdvx": [index({ "data.inGameID": 1, difficulty: 1 }, UNIQUE)], From b4a1070a1cbcea8eb3aec47db6990d187fa83a75 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Tue, 18 Jan 2022 18:02:30 +0000 Subject: [PATCH 7/8] CHANGELOG.md Fixes #627 --- server/CHANGELOG.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 server/CHANGELOG.md diff --git a/server/CHANGELOG.md b/server/CHANGELOG.md new file mode 100644 index 000000000..374aa0fcd --- /dev/null +++ b/server/CHANGELOG.md @@ -0,0 +1,41 @@ + + + +# Syntax + +| Type | Description | +| :----: | :---------------------------------------------------------------: | +| BUG | This was a bug fix. | +| ENH | This was an enhancement, An improvement to an existing behaviour. | +| FEAT | A new feature. | +| REWORK | An existing feature was reworked/changed. | + +# Changelog + +## 2.1.0 (Ongoing Development) + +- [FEAT] Added Jubeat Support. (#169) +- [FEAT] Added Pop'n Music Support. (#69) +- [FEAT] Added WACCA Support. (#598) +- [FEAT] Added support for Skye's pop'n hook. (#563) + +***** + +- [REWORK] KtRating is no longer the default rating algorithm for IIDX. It has been removed, and the new default is ktLampRating. (#597) + +***** + +- [ENH] Added a CHANGELOG.md file. (#627) +- [ENH] BATCH-MANUAL now supports the `percent` field for jubeat only. (#620) +- [ENH] Add support for jubility. (#163) +- [ENH] Move BPI related data (Kaiden Average and BPI) to IIDX charts, instead of being in a separate collection. This lets us display more stats on the UI. (#599) +- [ENH] Add game specific indexes. (#606) +- [ENH] Ratings are nullable now (#611) +- [ENH] Pre-HV Leggendaria songIDs are now properly resolved. (#487) + +***** + +- [BUG] UpdateClass now records the class as being recently achieved (i.e. display Chuuden -> Kaiden on the UI) (#589) +- [BUG] CHUNITHM's rating calculator no longer over-rewards SS rank scores. (#615) +- [BUG] Folder timelines now pull the oldest score for a given chart, rather than the newest. (#610) +- [BUG] Fixed bug where good plays on 3y3s long would get dropped due to a misunderstanding of a field. (#602) \ No newline at end of file From eacd0bc74b360c88a47a190611d3c2ce37232a1c Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Tue, 18 Jan 2022 22:59:58 +0000 Subject: [PATCH 8/8] Drop patreon --- server/.github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/.github/FUNDING.yml b/server/.github/FUNDING.yml index 82162eb02..c55044d83 100644 --- a/server/.github/FUNDING.yml +++ b/server/.github/FUNDING.yml @@ -1,7 +1,7 @@ # These are supported funding model platforms github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: zkldi +patreon: # zkldi open_collective: # Replace with a single Open Collective username ko_fi: zkldi tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel