Repository navigation
Description
Describe the Issue
Failed challenge submissions can still trigger navigation, close the completion dialog and clear project solution links. The learner can be taken away from the challenge even though the server has not saved the submission.
There are two related failure paths in the current client:
completionEpicnavigates for nearly every emitted action exceptupdateFailed. Later actions in the same failed submission stream still navigate, and the stream unconditionally closes the completion dialog.submitProjectalso unconditionally emitsupdateSolutionFormValues({}).postUpdate$callspost()before creating its observable.retry(3)therefore resubscribes to the same rejected promise instead of making another request.
The failure handler also calls createFlashMessage(standardErrorMessage) inside tap without emitting the returned action, so that message is not dispatched to Redux.
Affected Page
Challenge completion and project submission pages under https://www.freecodecamp.org/learn/.
Steps to Reproduce
This is a source-level reproduction against upstream commit 4c579f41036fe4866f5fd3f2bd9e727ee2da4260; a live browser reproduction has not been performed.
- Run the real
completionEpicwith a signed-in learner, a challenge whose tests pass, and apostmock that rejects with a network error. - Collect the emitted actions and spy on Gatsby's
navigate. - The original epic calls
navigateseven times in this fixture, emitscloseModal('completion'), and setsisAdvancingto true despite the failed save. - Repeat for a front-end project with populated solution/GitHub links. The failed stream also emits
updateSolutionFormValues({}), clearing those fields. - For the request helper, make the first mocked
postcall reject and the next resolve. Subscribe withretry(3). The original helper callspostonly once and rejects instead of recovering.
A non-OK HTTP response with JSON such as { "error": "Service Unavailable" } and no type: "error" is also treated as a successful completion by the original epic.
Expected behavior
On a failed submission, keep the learner on the challenge with their project links and completion dialog intact, reset the processing state, and dispatch a visible server or fallback error. Navigate and clear inputs only after a successful completion. A retry should make a fresh request while respecting the existing retry limit.
System
- OS: Windows
- Runtime: Node.js 26.13.1
- Tests: Vitest 4.1.12, RxJS 6.6.7 and Redux Observable 1.2.0
- Browser: not tested; the regression suite mocks navigation and network responses while exercising the real epic, action creators and RxJS operators.
Additional context
The prepared fix and regression tests are on this fork branch. The focused suite has 16 tests: 15 fail against the original source and all 16 pass with the fix. It covers rejected requests, API errors, retained project links, retry recovery/limits, signed-out learners, block navigation and exam results.
Prettier and focused Oxlint correctness checks pass. Full workspace lint/type checks, application build and browser tests have not been run. The isolated test configuration uses mocked selectors, flash-message side effects, network responses and navigation; the production request observable and completion epic are loaded directly.
Reporting the bug for triage before opening an upstream PR, following the contribution guide.
Activity