rage / mooc.fi

https://mooc.fi
5 stars 6 forks source link

Refactor: better JSON parse #1197

Closed mipyykko closed 1 year ago

mipyykko commented 1 year ago

Should provide better error messages for JSON parse errors in backend.

Also reverts reverts, in other words includes changes first introduced in https://github.com/rage/mooc.fi/pull/1193 which were reverted back and forth. Hopefully it was just a case of not using the latest docker image with the backend.

codecov[bot] commented 1 year ago

Codecov Report

Merging #1197 (03ee065) into master (c61a727) will decrease coverage by 0.88%. The diff coverage is 39.39%.

@@            Coverage Diff             @@
##           master    #1197      +/-   ##
==========================================
- Coverage   65.17%   64.30%   -0.88%     
==========================================
  Files         124      125       +1     
  Lines        5278     5306      +28     
  Branches     1225     1238      +13     
==========================================
- Hits         3440     3412      -28     
- Misses       1714     1767      +53     
- Partials      124      127       +3     
Flag Coverage Δ
backend 64.30% <39.39%> (-0.88%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...nd/bin/kafkaConsumer/common/userPoints/saveToDB.ts 94.44% <ø> (-0.30%) :arrow_down:
backend/bin/removeDuplicateExerciseCompletions.ts 60.71% <0.00%> (-11.29%) :arrow_down:
backend/services/google-cloud.ts 43.18% <0.00%> (-28.25%) :arrow_down:
backend/tests/index.ts 94.04% <ø> (ø)
backend/wsServer.ts 32.65% <6.89%> (-5.16%) :arrow_down:
backend/api/routes/userCourseSettings.ts 69.60% <20.00%> (+0.30%) :arrow_up:
...r/common/userPoints/exerciseCompletionFunctions.ts 54.74% <100.00%> (-0.66%) :arrow_down:
backend/lib/errors.ts 58.33% <100.00%> (+0.43%) :arrow_up:
backend/middlewares/fetchUser.ts 73.13% <100.00%> (+0.82%) :arrow_up:
backend/services/redis.ts 69.14% <100.00%> (+0.33%) :arrow_up:
... and 3 more

... and 2 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more