source-academy / frontend

Frontend of Source Academy, an online experiential environment for computational thinking (React, Redux, Saga, Blueprint)
https://sourceacademy.org
Apache License 2.0
103 stars 167 forks source link

Migrate to Redux Toolkit part 7 #2971

Closed RichDom2185 closed 6 months ago

RichDom2185 commented 6 months ago

Description

Based on @leeyi45's work done in #2874.

Intentionally split and only migrated some stuff to keep the diff readable.

I strongly recommend going through the changes commit by commit instead of going through the full diff of this PR. Please refer to the commit history for a list of changes.

Type of change

How to test

Everything should still work. Tests involving createStore are still failing at the moment, will fix in the next few days.

Checklist

chownces commented 6 months ago

Turns out saferTakeEvery is not so safe 🤓. Added the fix.

coveralls commented 6 months ago

Pull Request Test Coverage Report for Build 8937016269

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/commons/achievement/AchievementOverview.tsx 0 2 0.0%
src/commons/achievement/AchievementView.tsx 0 3 0.0%
src/commons/redux/utils.ts 12 22 54.55%
src/features/stories/StoriesActions.ts 5 17 29.41%
src/commons/sagas/StoriesSaga.ts 1 18 5.56%
src/commons/application/actions/SessionActions.ts 52 70 74.29%
src/commons/mocks/BackendMocks.ts 12 34 35.29%
src/commons/sagas/BackendSaga.ts 107 250 42.8%
<!-- Total: 196 423 46.34% -->
Files with Coverage Reduction New Missed Lines %
src/commons/sagas/BackendSaga.ts 5 43.14%
<!-- Total: 5 -->
Totals Coverage Status
Change from base Build 8936341133: -0.6%
Covered Lines: 5146
Relevant Lines: 14691

💛 - Coveralls
RichDom2185 commented 6 months ago

Turns out saferTakeEvery is not so safe 🤓. Added the fix.

Thanks! My bad, I missed out the fact that saferTakeEvery takes in the action and not the action type (like takeEvery) 😅