Commit graph

1347 commits

Author SHA1 Message Date
Christian Fehmer
cd99d5af16
test: add WeeklyXpLeaderboards integration tests (@fehmer) (#6843) 2025-08-07 14:48:14 +02:00
Christian Fehmer
c8a91ede52
test: fix flaky user tests (@fehmer) (#6837) 2025-08-07 14:47:35 +02:00
Christian Fehmer
01ed9322ec
test: update to vitest3 (@fehmer) (#6811)
- **test: use mongodb testcontainer (@fehmer)**
- **don't run integration tests in parallel**
- **fix premium test**
- **refactor, cleanup**
- **refactor, cleanup**
- **test: add integration tests for daily leaderboards (@fehmer)**
- **trigger**
- **trigger**
- **test: update to vitest3 (@fehmer)**
2025-08-04 15:55:10 +02:00
Christian Fehmer
9c41fd5d04
test: add unit tests for daily leaderboards (@fehmer) (#6802)
- **refactor existing test to use it.for**
- **use testcontainers**
2025-08-04 15:28:55 +02:00
Christian Fehmer
d9009e51cc
test: use mongodb testcontainer (@fehmer) (#6808) 2025-08-04 15:10:41 +02:00
Christian Fehmer
c1a681c17f
test: split integration tests (@fehmer) (#6807)
- **trigger**
- **test: split integration tests (@fehmer)**
2025-07-30 13:22:40 +02:00
Christian Fehmer
aa94a8afed
chore: update nodejs to 20.19.4 (@fehmer) (#6805) 2025-07-30 10:06:04 +02:00
Cameron
2180e3b603
chore(deps): upgrade oxlint to 1.8.0, fix errors (@camc314) (#6776)
### Description

This PR updates oxlint to 1.8.0 and fixes the resulting errors in order
to keep oxlint's ecosystem CI green.

Thanks for using oxlint

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2025-07-24 14:32:12 +02:00
Jack
69cbbe4ab2
refactor(contracts / schemas): move schemas into their own package (@miodec) (#6754) 2025-07-21 14:55:54 +02:00
Jack
92790f3682
refactor(config): config metadata (@miodec) (#6753)
Create config metadata object
Move all the special code on config change to config listeners
Create a generic set function which will work with the metadata object
to update any config key
Update all setters to use the generic set.
(Later probably only use the generic settter and remove all the specific
ones)
Also orders config groups and config schema.

---------

Co-authored-by: Christian Fehmer <cfe@sexy-developer.com>
2025-07-21 13:50:33 +02:00
Miodec
41495981a8 chore: bump oxlint version 2025-07-19 15:02:14 +02:00
Miodec
255fd7f410 chore: only log daily changes 6 hours after the reset 2025-07-19 02:09:09 +02:00
Miodec
c6d9033005 chore: move result logging later, log top 10 daily 2025-07-17 09:37:06 +02:00
Miodec
c4590a2939 chore: log only up to 2 minute tests 2025-07-17 09:27:48 +02:00
Miodec
c9986bbc4c chore: slice long messages 2025-07-17 09:19:39 +02:00
Miodec
b15520f0b3 chore: add ability to log results 2025-07-17 01:24:47 +02:00
Christian Fehmer
a4de8dfda6
impr(leaderboard): daily mode/language buttons based on backend configuration (@fehmer) (#6713)
Co-authored-by: Miodec <jack@monkeytype.com>
2025-07-14 15:32:09 +02:00
Christian Fehmer
5aec2c9a17
fix(docker): use frontend url for firebase admin (@fehmer) (#6730)
fixes #6728

---------

Co-authored-by: Jack <jack@monkeytype.com>
2025-07-14 15:30:34 +02:00
Christian Fehmer
8be3a3cc9b
fix(leaderboard): use minTimeTyping from configuration (@fehmer) (#6710)
We added `minTimeTyping` to the configuration but it was only used to
create the indicies.
2025-07-09 12:09:49 +02:00
Christian Fehmer
9b26793a6d
chore: update express to 5.1.0 (@fehmer) (#6691) 2025-07-03 15:43:01 +02:00
Christian Fehmer
afbff1bcf6
fix(docker): Allow to self-host without firebase config (@fehmer) (#6685)
fixes #6505
2025-07-01 13:06:06 +02:00
Seif Soliman
e4a102ac64
impr(results): allow PBs with stop on letter if accuracy is 100% (@byseif21) (#6611) 2025-06-26 17:11:15 +02:00
Miodec
63b63ffa9c chore: update plugins overrides 2025-06-14 15:33:52 +02:00
Miodec
4c05dd8326 chore: bump oxlint version 2025-06-14 14:43:05 +02:00
Miodec
2d008461ed chore: catch firebase internal errors when trying to auth 2025-06-14 14:11:05 +02:00
Miodec
04fbd81c10 chore: bump oxlint version 2025-05-29 13:23:13 +02:00
Christian Fehmer
d6ae7cf7c4
fix: compatability check header shown if client is using cached responses (@fehmer) (#6602)
If frontend and backend are deployed with a new COMPATABILITY_CHECK
header frontend might show the backend version is lower because of the
http header of a cached response.

Adding the COMPATABILITY_CHECK version as part of the etag fixes this.
2025-05-27 16:59:49 +02:00
Jack
ea90e0a99e
refactor: dont allow nullable numbers (@miodec) (#6564)
Enables strict boolean expressions rule for nullable numbers
2025-05-16 16:04:19 +02:00
Miodec
8370de1fa4 impr: add function to clearstreakhouroffset
!nuf
2025-05-12 13:52:37 +02:00
Christian Fehmer
eb092cea1c
refactor: move languages to contracts (@fehmer) (#6497) 2025-05-07 14:02:27 +02:00
Miodec
255c4b944d fix: unable to link discord if user has no avatar 2025-04-30 18:41:03 +02:00
Miodec
c666d13c96 impr: parse response from discord api with zod
!nuf
2025-04-29 13:53:02 +02:00
Christian Fehmer
212b8d38cb
refactor: make funbox settings an array (@fehmer) (#6487)
change funbox from "hash separated values" to array.

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2025-04-29 11:31:44 +02:00
Miodec
ab9cef010e chore: swap monkeyerror for error to not expose actual error message to the frontend 2025-04-26 21:53:16 +02:00
Jack
e06f7f41cf
refactor: add trycatch util (@miodec) (#6492)
Adds trycatch util to cleanup try catch code.
2025-04-26 21:24:39 +02:00
Miodec
a59f99a533 refactor: protect against null, remove nullish coalescing 2025-04-26 18:56:58 +02:00
Seif Soliman
86383cf9ef
refactor(backend): improve redis and json.parse type safety with zod (@byseif21, @miodec) (#6481)
### Description

refactored backend files to enhance type safety and reliability using
Zod validation and Redis instead of JSON.parse , I tried to avoid the
files that isn't necessary tho so I hope I don't miss any or included
unnecessary ones!! didn't fully test only verified code compilation and
partial tests without Redis!!.


Should Close #5881 
Related to #6207

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2025-04-24 16:25:43 +02:00
Miodec
a424f96480 chore: upgrade oxlint 2025-04-23 18:54:33 +02:00
Miodec
d3f3a834e3 refactor: remove unnecessary json parse 2025-04-23 18:43:38 +02:00
Miodec
0b05b3c2fd refactor: enable ban-ts-comment rule 2025-04-16 19:15:30 +02:00
Jack
cac8835c77
chore: add oxlint (@miodec) (#6455)
Use oxlint for general linting to provide much quicker feedback. Keep
eslint for type-aware rules. Fully switch to oxlint once it supports
type-aware.
2025-04-16 17:18:50 +02:00
Christian Fehmer
f6d9b7c3ef
impr: lazy load chartData on results (@fehmer) (#6428)
Optimize results endpoint by removing heavy or unused data. 

We load the whole result chart data for up to 1000 results each time,
but it is very unlikely the user will view the charts for all old
results. By removing the size in my tests went down from 1152kb to
276kb.

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2025-04-08 13:46:40 +02:00
Miodec
115b0d7292 impr: pass lboptout to bot linking command
!nuf
2025-04-02 22:01:44 +02:00
Miodec
2c13284528 impr: pass lboptout to bot linking command
!nuf
2025-04-02 21:55:34 +02:00
Christian Fehmer
b1d75fb077
fix: local development using docker not working with pnpm (@fehmer) (#6401)
!nuf
2025-03-26 13:11:02 +01:00
Miodec
d567130053 chore: remove logs, cache is fine 2025-03-20 17:56:10 +01:00
Miodec
33977b71e6 chore: ugly console log to check if the cache is working for sure 2025-03-20 17:50:40 +01:00
Miodec
4bfe6c9bf7 impr: cache leaderboard collection size to improve performance
!nuf
2025-03-20 14:54:29 +01:00
Christian Fehmer
e647d875f0
impr: error handling on user deletion (@fehmer) (#6363)
!nuf
2025-03-17 16:05:46 +01:00
Nad Alaba
932d0e166e
build: fix openapi spec path for docs & stats endpoints on dev (@NadAlaba) (#6343)
### Description

1. fix openapi specification path so that /docs endpoint would work on
dev.

> Error: ENOENT: no such file or directory, stat
'backend/src/static/api/public.html' Stack: Error: ENOENT: no such file
or directory

2. fix openapi specification path so that API Operation would work on
/stats endpoint on dev.

> Cannot read openApi specification from
backend/src/api/routes/../../static/api/openapi.json. Swagger stats will
not fully work.

![stats](https://github.com/user-attachments/assets/82f3e8b4-814c-4ede-ba67-8da53dacad87)

3. remove unneeded `files` & `ts-node` options from `tsconfig.json` in
various places.

> File 'backend/src/types/types.d.ts' not found.
  The file is in the program because:
    Part of 'files' list in tsconfig.json

4. add the missing `pnpm test` script to the funbox package.
2025-03-12 16:20:46 +01:00