Commit graph

625 commits

Author SHA1 Message Date
Bruce Berrios efbfffaa75
Fix daily leaderboard score (#3031)
* Fix daily leaderboard score

* Remove comment
2022-05-27 14:25:46 +02:00
Bruce Berrios cd767bff1c
Use better score metric (#3030) 2022-05-27 02:21:23 +02:00
Bruce Berrios 5d45898893
check if user is banned (#3029) 2022-05-26 22:13:42 +02:00
Miodec 1d64387b92 logging daily lb update 2022-05-26 18:44:50 +02:00
Miodec 532db055b4 rate limit 2022-05-26 16:48:26 +02:00
Bruce Berrios 0ef52ed9da
Add daily leaderboards (#3023) bruception
* Setup daily leaderboards backend (#2987) bruception

* Setup daily leaderboards backend

* Add enabled checks

* Consistent naming

* Add initial unit tests

* Use more flexible daily leaderboard rule logic

* Fix seed rule

* Add LRU Cache + Rank Calculation

* Use native functions

* Optional daily leaderboard rank

* Proper status code for invalid lb mode

* Add result criteria check

* Make daily leaderboard cache size configurable

* Add Ape endpoint for daily leaderboard (#2997)

* support for switching to viewing daily lbs

* test

* buttons

* only checking daily if user has more than 2 hours typed

* updated structure

* setting rank if its undefined

* only when daily

* storing uid

* fixed media queries

* Daily leaderboards pagination (#3006)

* Pagination

* Remove with scores

* Add daily leaderboard rank (#3014) Bruception

* Add daily leaderboard rank

* Remove unused import

* Use object instead

* Add client logic

* Add limit checks

* Announce top daily leaderboard results (#3017)

* Add rank in daily leaderboard results (#3022)

* not showing lb memory and top % on daily

* Fix rank pagination

* Actual fix

* showing new rank

Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-05-26 16:30:11 +02:00
Evan 66c912e817
use interfaces instead of types (#3002) ferotiq
* use interfaces instead of types

* Update custom-text.ts
2022-05-26 12:19:01 +02:00
Miodec 2e3db31a39 changed error condition 2022-05-24 00:31:51 +02:00
Miodec b029d86460 added note about the package to the api docs. closes #2999 2022-05-23 21:19:54 +02:00
Miodec 42d984981a 2 hours minimum to be placed on the lb 2022-05-21 01:32:09 +02:00
Miodec 12b4b899a5 overriding name later 2022-05-21 01:18:09 +02:00
Miodec 7c711bc4c2 only getting accounts with more than an hour of typing 2022-05-21 01:15:15 +02:00
Miodec 632b7e4bf6 Merge branch 'master' of https://github.com/Miodec/monkeytype 2022-05-21 00:13:13 +02:00
Miodec 4710a70e0c overriding result name to be sure 2022-05-21 00:12:50 +02:00
Bruce Berrios 294ff4c95a
Remove uid from last result (#2998) 2022-05-19 20:44:24 +02:00
Bruce Berrios 1384e9f81d
Add pretty check (#2990) bruception
* Add pretty check

* test

* test

* Add pretty check

* Add condition check

* Enforce style on code changes

* Update scripts

* Any src
2022-05-19 11:31:18 +02:00
Jack 46e0c5c960
Auto ban (#2984)
* added auto ban if user triggers anticheat too much

* updated base configuration

* autoban is optional

* storing updated autoban array

* only checking autoban in time 15 and 60

* miliseconds

* removed unnecessary if check

* returning if already banned

* storing now in variable
greater not greater equal

* moved constant outside function

* using partial type

* renamed variables

* renamed to autoBanTimestamps

* added autoban tests

* increased coverage minimum

* slightly better test

* added autoBanTimestamps checks to other tests
2022-05-16 21:03:44 +02:00
Miodec 699ddd8737 renamed field 2022-05-13 09:41:41 +02:00
Bruce Berrios 6c666f12ba
Add user creation flow test (#2971) bruception 2022-05-13 09:05:57 +02:00
Bruce Berrios 0a371b531a
Add more tests (#2965) Bruception and sondrekje
* Cover updateName

* Test clearPb, export getUsersCollection for testing purposes

* Add base coverage

* Month -> thirty days

Co-authored-by: Sondre Kjempekjenn <sondre.kjempekjenn@gmail.com>
2022-05-11 14:08:06 +02:00
Miodec 41c142b49a blocking users from submitting results if they need to change name 2022-05-08 20:47:45 +02:00
Miodec 616d068e2f needsToUpdateName > needsToChangeName 2022-05-08 16:59:45 +02:00
Miodec 0a1ac828e7 moved invalid name check higher 2022-05-08 16:58:57 +02:00
Miodec 0a4a7eabe7 added test to make sure users cant take an unavailable name 2022-05-08 14:54:15 +02:00
Miodec a0f6fabf10 is name available is async 2022-05-08 14:24:02 +02:00
Miodec 1baa5c1651 not checking last name change if user needs to change name 2022-05-08 13:20:18 +02:00
Bruce Berrios cdbc0bf770
Add logic to handle duplicate names (#2958) 2022-05-08 08:59:12 +02:00
Bruce Berrios ee5ef57d89
Delete bot dal (#2953) 2022-05-06 17:36:23 -05:00
Evan d9ffcfb4ee
Preparing for George Update (#2895)
* bot-commands rename

* removed bot dal

* reomoved unnecessary configuration entry

* quotes:code_javascript: Add regex-heavy quote. (#2929) markstos

* quotes:code_javascript: Add regex-heavy quote.

This quote contains a long regex that will be a workout for typing
symbols and numbers.

Source code can be confirmed to available under an open source license
here: https://github.com/markstos/parse-coordinates/blob/master/index.js

* fixed length

Co-authored-by: Miodec <bartnikjack@gmail.com>

* fixed script names

* fixed incorrect path

* definitely didnt forget about those

Co-authored-by: Miodec <bartnikjack@gmail.com>
Co-authored-by: Mark Stosberg <mark@rideamigos.com>
Co-authored-by: Jack <jack@monkeytype.com>
2022-05-06 23:48:15 +02:00
Miodec 6d52d8ce1b fixed incorrect path 2022-05-05 23:28:02 +02:00
Bruce Berrios 8095dd6bfc
Add test step in pr-check action (#2942) Bruception
* Add test step in pr-check action

* Add jest action

* Specify wd

* Remove action

* Remove test

* Add anti-cheat check
2022-05-05 23:06:40 +02:00
Sondre Kjempekjenn afd288a717
Testing - mock setup for redis (#2944) 2022-05-05 14:05:31 -04:00
Bruce Berrios 91220a5bdc
Move backend source files into src folder (#2943) 2022-05-05 19:27:00 +02:00
Bruce Berrios 38ed2f60aa
Remove await (#2941)
* Remove await

* Remove async

* Remove await server
2022-05-05 11:13:09 -04:00
Sondre Kjempekjenn 88a587c5c2
Feature/backend test (#2937) sondrekje
* Switch to ts-node-dev for development

* Minimal setup for backend testing

* Basic controller test

* __tests__ directory

* Delete old DB client

* Improve tests, ensure DB cleanup only runs for inMemory DB
2022-05-05 15:19:31 +02:00
Bruce Berrios 73f21c9cc5
Remove class syntax from george (#2935)
* Remove class syntax from george

* Remove boolean
2022-05-05 02:00:12 +02:00
Bruce Berrios e5c295cfe4
Remove class syntax from db client (#2940) Bruception
Co-authored-by: Jack <jack@monkeytype.com>
2022-05-05 01:57:51 +02:00
Sondre Kjempekjenn 9634b93fc3
Add docker-compose and instructions to README (#2939) sondrekje 2022-05-05 01:52:17 +02:00
Miodec bf8862fe74 not exiting in dev mode when redis connection failed
closes #2930
2022-05-04 19:27:34 +02:00
Miodec 8524646380 renamed folder dao to dal 2022-05-04 01:51:25 +02:00
Miodec ec8ec49b71 Merge branch 'master' of https://github.com/Miodec/monkeytype 2022-05-04 01:48:29 +02:00
Bruce Berrios 6ee84b2484
DAO -> DAL (#2928)
* DAO -> DAL

* This what?

Co-authored-by: Jack <jack@monkeytype.com>
2022-05-04 01:47:51 +02:00
Miodec de97d798eb moved data validation to anticheat repo 2022-05-04 01:44:13 +02:00
Miodec b27f5c935b removed todo 2022-05-04 01:21:07 +02:00
Miodec ca2c82db38 removed unused types 2022-05-04 01:20:26 +02:00
Jack e6982f293d
Small Dao dals (#2927)
* converted preset dao to dal

* psa dao > dal

* typo

* config dao > dal

* public stats dao > dal

* fixed bad merge

* removed this

* removed comment
2022-05-04 00:43:58 +02:00
Bruce Berrios 9b7b5feb71
BotDAO -> BotDAL (#2926) bruception 2022-05-04 00:38:57 +02:00
Miodec 49befe4f76 unborked the code 2022-05-04 00:34:38 +02:00
Miodec 61292dfb8c fixed previous commit 2022-05-04 00:23:31 +02:00
Miodec a4ca55cb73 converted report dao to dal 2022-05-04 00:17:34 +02:00