Merge branch 'hotfix/v2.1.10' into develop

This commit is contained in:
zkldi
2022-03-24 16:11:08 +00:00
2 changed files with 17 additions and 13 deletions
+4
View File
@@ -15,6 +15,10 @@ not generally be shown to end users.
# Changelog
# 2.1.10
- [BUG] Users can no longer permanently lock themselves out of an import by making an import while one is ongoing.
# 2.1.9
- [ENH] Add an endpoint on UGPT/folder/:folderID/stats. This returns lamp and grade distributions for this ugpt:folder combo.
@@ -64,20 +64,20 @@ export default async function ScoreImportMain<D, C>(
logger = providedLogger;
}
const hasNoOngoingImport = await CheckAndSetOngoingImportLock(user.id);
if (hasNoOngoingImport) {
logger.info(`User ${userID} made an import while they had one ongoing.`);
// @danger
// Throwing away an import if the user already has one outgoing is *bad*, as in the case
// of degraded performance we might just start throwing scores away.
// Under normal circumstances, there is no scenario where a user would have two ongoing
// imports at the same time - even if they were using single-score imports on a 5 second
// chart, as each score import takes only around ~10-15milliseconds.
throw new ScoreImportFatalError(409, "This user already has an ongoing import.");
}
try {
const hasNoOngoingImport = await CheckAndSetOngoingImportLock(user.id);
if (hasNoOngoingImport) {
logger.info(`User ${userID} made an import while they had one ongoing.`);
// @danger
// Throwing away an import if the user already has one outgoing is *bad*, as in the case
// of degraded performance we might just start throwing scores away.
// Under normal circumstances, there is no scenario where a user would have two ongoing
// imports at the same time - even if they were using single-score imports on a 5 second
// chart, as each score import takes only around ~10-15milliseconds.
throw new ScoreImportFatalError(409, "This user already has an ongoing import.");
}
const timeStarted = Date.now();
SetJobProgress(job, "Parsing score data.");