Skip to content

fix: make application imports side-effect free - #4

Closed
adity982 wants to merge 5 commits into
mainfrom
agent/fix-import-and-insight-side-effects
Closed

adity982 wants to merge 5 commits into
mainfrom
agent/fix-import-and-insight-side-effects

Conversation

@adity982

@adity982 adity982 commented Jul 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • make importing the Express application side-effect free
  • export start() while preserving npm start behavior
  • add a subprocess regression test that fails if an import connects to MySQL or opens the server

Why

src/app.js currently connects to MySQL and opens a listener whenever it is imported, which prevents isolated tests and makes the application harder to embed safely.

The earlier insight-order change was removed from this branch because it shipped independently in #1.

Validation

  • existing Node 18/20/22 CI will run npm run lint and npm test on the rewritten branch
  • the new test requires no database credentials or network access

Closes #2

@adity982 adity982 changed the title Fix import and insight side effects fix: make application imports side-effect free Jul 26, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #5. The replacement starts from current main, excludes the insight-engine changes already shipped in #1, and keeps the diff focused on import-safe startup, its regression test, and README guidance.

@adity982 adity982 closed this Jul 27, 2026
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.

Importing the Express app starts MySQL and the HTTP server

1 participant