File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ import {
3232 replaceLegacyValues ,
3333} from "../../utils/result" ;
3434import { Configuration } from "@monkeytype/contracts/schemas/configuration" ;
35- import { addLog } from "../../dal/logs" ;
35+ import { addImportantLog , addLog } from "../../dal/logs" ;
3636import {
3737 AddResultRequest ,
3838 AddResultResponse ,
@@ -214,6 +214,10 @@ export async function addResult(
214214 const completedEvent = req . body . result ;
215215 completedEvent . uid = uid ;
216216
217+ if ( user . suspicious ) {
218+ await addImportantLog ( "suspicious_user_result" , completedEvent , uid ) ;
219+ }
220+
217221 if ( isTestTooShort ( completedEvent ) ) {
218222 const status = MonkeyStatusCodes . TEST_TOO_SHORT ;
219223 throw new MonkeyError ( status . code , status . message ) ;
Original file line number Diff line number Diff line change @@ -507,6 +507,7 @@ type RelevantUserInfo = Omit<
507507 | "note"
508508 | "ips"
509509 | "testActivity"
510+ | "suspicious"
510511> ;
511512
512513function getRelevantUserInfo ( user : UserDAL . DBUser ) : RelevantUserInfo {
@@ -521,6 +522,7 @@ function getRelevantUserInfo(user: UserDAL.DBUser): RelevantUserInfo {
521522 "note" ,
522523 "ips" ,
523524 "testActivity" ,
525+ "suspicious" ,
524526 ] ) as RelevantUserInfo ;
525527}
526528
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ export type DBUser = Omit<
6262 canManageApeKeys ?: boolean ;
6363 bananas ?: number ;
6464 testActivity ?: CountByYearAndDay ;
65+ suspicious ?: boolean ;
6566} ;
6667
6768const SECONDS_PER_HOUR = 3600 ;
You can’t perform that action at this time.
0 commit comments