Course home: clearing `start_course` adds a history entry
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 80/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, react
- Domain
- frontend
Research direction
Start in src/course-home/outline-tab/OutlineTab.jsx around lines 102-117, the effect that strips ?start_course=1 after sending enrollment.email.clicked.startcourse; the call passes replace: true inside the To object instead of the second options argument. Compare with WeeklyLearningGoalCard.jsx, which still uses history.replace for weekly_goal. Read the v6 useNavigate docs on options.replace, then check the existing outline-tab tests for the router setup and add a case asserting the cleanup navigation was a replace, not a push. Done means Back leaves the course home after arriving with ?start_course=1, the event fires once, and that test fails against the current call.
Written by the indexing model from the issue text.
Description
Clearing start_course adds a history entry. When a learner opens the course home from the enrollment email, the outline tab sends the enrollment.email.clicked.startcourse event and takes ?start_course=1 out of the address. It does that with a new history entry, where it means to replace the current one. Back then returns to the ?start_course=1 address, the event is sent a second time, and the learner is moved forward again. It has been this way since #1128 (2023-10), the React Router v6 upgrade.
A test of the same call shows the router recording the navigation as a push. What Back does follows from that and has not been watched in a browser.
Status (2026-11-18): fixed in the frontend-base version of Learning, the package under frontend-base/ on the frontend-base branch, by #2252. The frontend-build and frontend-platform version under src/ still has it.
[!NOTE]
This issue was written by Claude (Claude Code) and reviewed before posting.
Claude Plan
Mechanism
-
OutlineTab.jsxclears the parameter withnavigate({ pathname, search, replace: true }):replaceis a key of the first argument. -
React Router's
navigatetakesreplacein its second argument. From theuseNavigatepage of the v6 documentation:Either pass a
Tovalue (same type as<Link to>) with an optional secondoptionsargumentand, under
options.replace:Specifying
replace: truewill cause the navigation to replace the current entry in the history stack instead of adding a new one. -
A
Toobject carries a pathname, a search string and a hash. Areplacekey in it is not read, so the call navigates with the default, a push.
History
- #1128 (2023-10-05) turned
history.replace({ search: currentParams.toString() })into thenavigatecall and putreplace: truein the first argument (the commit). - The weekly goal card's cleanup of
weekly_goal, inWeeklyLearningGoalCard.jsx, still callshistory.replaceand is not affected.
What a learner sees
After arriving with ?start_course=1, the history holds two entries for the course home: the address with the parameter, and the one without. Back goes to the first. The effect runs again there, sends enrollment.email.clicked.startcourse again and adds the clean address again. Each press of Back repeats that, so Back does not leave the page and the event is counted once per press.
Fix
navigate({ pathname, search }, { replace: true }), with a case that fails when the cleanup adds an entry. #2252 does this in the frontend-base package: its case asserts that the router's last navigation was a replace, and it fails with the call as it is here, the router reporting a push.
Acceptance
- After arriving with
?start_course=1, Back leaves the course home -
enrollment.email.clicked.startcourseis sent once - A test fails if the cleanup adds a history entry
- Dominant language
- JavaScript
- Stars
- 71
- Forks
- 341
- Avg merge
- 4d 18h
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openedx/frontend-app-learning
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openedx/frontend-app-learning#2250 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
openedx/frontend-app-learning#2147 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 94/100
openedx/frontend-app-learning#2119 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
openedx/frontend-app-learning#2059 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
openedx/frontend-app-learning#2051 ·
Maintainers usually reply within 1 day
All issues in openedx/frontend-app-learning
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
check:passed logos:edit
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keysPossibly taken @pcbeingused333 claimed this today. OpenBug db: d1-sqlite Payload OSS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19766 ·
Maintainers usually reply within 1 day
-
Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
inverse-inc/packetfence#9707 ·
Maintainers usually reply within 1 day
-
feedback simulation workshop
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
githubnext/gh-aw-workshop#5896 ·
Maintainers usually reply within 1 day