Skip to content

chore(middlewareNode): remove dead lesson FEN data from lessons.js (Issue 11) - #261

Open
Deepesh-Katudia wants to merge 2 commits into
mainfrom
chore/issue-11-lessons-dead-data
Open

Deepesh-Katudia wants to merge 2 commits into
mainfrom
chore/issue-11-lessons-dead-data

Conversation

@Deepesh-Katudia

@Deepesh-Katudia Deepesh-Katudia commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Issue 11, step D2.1: delete the dead data at the bottom of middlewareNode/src/routes/lessons.js.

Lines 610–861 came after module.exports = router;. They assigned a legacy array of lesson end-FEN positions to list with no let/const, so loading the file created a global variable. Nothing reads it. The only mention is inside commented-out code in the /stick handler (lines 55–56). It came in with the July 5 Stockfish Chat Framework merge.

The file goes from 861 lines to 609. Nothing else changes.

Type of Change

  • Refactor (no behavior change)

Behavior

Routes, status codes, response shapes and exports are all unchanged. The only runtime difference is that the global list no longer leaks:

before: typeof globalThis.list after require('./src/routes/lessons.js') === "object"
after:  typeof globalThis.list after require('./src/routes/lessons.js') === "undefined"

Conflicts

None expected. No open branch touches this part of the file. Puzzle-Themes edits line 39 (getDb), and feature/currency-ledger-infra edits about line 296.

Testing

npm test in middlewareNode:

Result
Before (main) Test Suites: 22 passed, 22 total · Tests: 264 passed, 264 total
After Test Suites: 22 passed, 22 total · Tests: 264 passed, 264 total

…ssue 11)

Lines 610-861 sat after `module.exports = router;` and assigned a legacy
array of lesson end-FEN positions to `list` with no let/const, which
leaked a global variable every time the file loaded. Nothing reads it;
the only mention is inside commented-out code in the /stick handler.
It came in with the July 5 Stockfish Chat Framework merge.

No behavior change: same routes, same exports. Only the global `list`
leak goes away.
Copilot AI balanced review requested due to automatic review settings October 1, 2026 20:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ToldYO
ToldYO self-requested a review October 7, 2026 14:36

@ToldYO ToldYO left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge approved. good job removing dead code and an accidental global variable leak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants