Skip to content

Commit

Permalink
fix(server): only saving isPb property in the database if the result …
Browse files Browse the repository at this point in the history
…was a pb

this was the previous behaviour but #4980 broke it
  • Loading branch information
Miodec committed Feb 7, 2024
1 parent 6c1c227 commit ead765d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/src/utils/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export function buildDbResult(
if (ce.incompleteTestSeconds === 0) delete res.incompleteTestSeconds;
if (ce.afkDuration === 0) delete res.afkDuration;
if (ce.tags.length === 0) delete res.tags;
if (ce.isPb === false) delete res.isPb;

if (ce.keySpacingStats === undefined) delete res.keySpacingStats;
if (ce.keyDurationStats === undefined) delete res.keyDurationStats;
Expand Down
2 changes: 2 additions & 0 deletions shared-types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ declare namespace SharedTypes {
| "incompleteTests"
| "customText"
| "quoteLength"
| "isPb"
> & {
correctChars?: number; // --------------
incorrectChars?: number; // legacy results
Expand All @@ -239,6 +240,7 @@ declare namespace SharedTypes {
tags?: string[];
customText?: CustomText;
quoteLength?: number;
isPb?: boolean;
}
>;

Expand Down

0 comments on commit ead765d

Please sign in to comment.