Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1407 +/- ##
==========================================
+ Coverage 81.17% 87.17% +6.00%
==========================================
Files 51 47 -4
Lines 834 772 -62
Branches 240 219 -21
==========================================
- Hits 677 673 -4
+ Misses 150 95 -55
+ Partials 7 4 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
80c1b92 to
3db6bf2
Compare
Server state moves to per-resource queries, the shared form state (open field, drafts, errors, save status) to a React context, and redux, redux-saga, redux-thunk and reselect go away. The service module is renamed to api.js, following Learner Dashboard and Account. Closes #1404 Co-Authored-By: Claude <noreply@anthropic.com>
3db6bf2 to
5c773a8
Compare
|
Self-review notes, three passes; every finding is fixed and folded into the commit. First pass: the alert for a rejected photo upload outlived a successful "Remove photo", since it read the save mutation's error and nothing reset it (the delete handler now does). Also two context actions nothing called, a preferences cache merge without the guard the account merge has, no direct test for Second pass: opening or closing a field left a failed save's Third pass: leftovers only. |
Description
Replaces the Redux stack (redux, react-redux, redux-saga, redux-thunk, reselect and their dev tooling) with @tanstack/react-query. The account, preferences, certificates and country allow-list become per-resource queries, the saves and photo changes become mutations that patch the cache, and the shared form state (the open field, drafts, per-field errors, save status) moves to a React context.
services.jsis renamed toapi.js, as in Learner Dashboard and Account. TheQueryClientProviderinindex.jsxis temporary: the frontend-base conversion (#1405) removes it in favor of the shell's.This is the first PR in the stack described in #1246, done on the current codebase so it can be reviewed separately from the frontend-base conversion, as openedx/frontend-app-account#1468 was for Account.
A few behaviors change along the way. Errors the sagas used to rethrow, which cancelled the root saga so the page ignored every later action until a reload, are now contained: an account fetch that fails with anything but a 404 shows the error page instead of a spinner that never ends, and a save that fails without field errors resets the form. Opening or closing a field also clears the outcome of the last save, so a field error from a failed save no longer reappears when that field is reopened, and a field opened while another one still shows "Saved" starts clean rather than inheriting that state and losing its drafts to the reset the saga ran 300ms later. An unknown username renders the not-found page in place instead of navigating to
/notfound. A rejected photo upload now shows the LMS's message; the alert for it existed but was never fed. After moving a legacyall_usersaccount to per-field privacy, the account and preferences are refetched rather than kept as fetched. The fiveProfilePagesnapshots are replaced by behavior assertions, and the unusedstate.userAccountselector,disabledCountries,mock_data.jsand thesavingEditedBiofixture go without replacement.Closes #1404.
LLM usage notice
Built with assistance from Claude.