Skip to content

Failed challenge submissions navigate away and clear project links #71780

Backlog
notsoravii/freeCodeCamp
#7

Description

@henokwon

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:

  • completionEpic navigates for nearly every emitted action except updateFailed. Later actions in the same failed submission stream still navigate, and the stream unconditionally closes the completion dialog. submitProject also unconditionally emits updateSolutionFormValues({}).
  • postUpdate$ calls post() 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.

  1. Run the real completionEpic with a signed-in learner, a challenge whose tests pass, and a post mock that rejects with a network error.
  2. Collect the emitted actions and spy on Gatsby's navigate.
  3. The original epic calls navigate seven times in this fixture, emits closeModal('completion'), and sets isAdvancing to true despite the failed save.
  4. Repeat for a front-end project with populated solution/GitHub links. The failed stream also emits updateSolutionFormValues({}), clearing those fields.
  5. For the request helper, make the first mocked post call reject and the next resolve. Subscribe with retry(3). The original helper calls post only 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

  1. added
    platform: learn
    status: waiting triage
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: learnstatus: waiting triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions