Skip to content

Mdxg router spec runs composable outside a component instance #587

Closed

Description

@harlan-github-agent

In every reviewed Test run from 37579687657 (attempt 1, 2026-10-07T06:06Z) to 37807825636 (attempt 1), job site / test, step Run pnpm test:run, modules/mdxg/test/document-router.spec.ts emits [Vue warn]: onBeforeUnmount is called when there is no active component instance 7 times per run (112 total) because the spec calls useMdxgDocumentRouter outside setup, so the cleanup hook never registers and each test leaks a popstate listener on window.

Target: modules/mdxg/test/document-router.spec.ts

Verify with: pnpm exec vitest run modules/mdxg/test/document-router.spec.ts 2>&1 | grep -c 'onBeforeUnmount is called' returns 0

Estimated to change 1 file.

The ci-review routine opened this issue automatically on its 2026-10-08T21:00:00.000Z run. It is not Harlan's own report. Close it to reject the proposal, and the reason you give stops it being offered again.

Activity

  1. harlan-github-agent commented on Oct 8, 2026

    @harlan-github-agent
    ContributorAuthor

    🤖 ISSUE TRIAGE

    Harlan Agent Kit posted this automated triage. It is not Harlan's personal assessment or commitment. AI open source policy.

    • Route: Ready to implement
    • Difficulty: 2/5
    • Impact: 2/5
    • Reproduction: Yes
    • Codebase review: Not needed
    • Summary: Confirmed by code inspection: useMdxgDocumentRouter (modules/mdxg/src/runtime/composables/useMdxgDocumentRouter.ts:171-176) registers a window popstate listener and removes it in onBeforeUnmount, but all 7 tests in modules/mdxg/test/documen
    • Next action: In modules/mdxg/test/document-router.spec.ts, wrap each useMdxgDocumentRouter call in a mounted dummy component (withSetup helper that creates and mounts an app, returning the composable result and an unmount fn), then verify: pnpm exec vitest run modules/mdxg/test/document-router.spec.ts 2>&1 | grep -c 'onBeforeUnmount is called' returns 0.
  2. added
    harlan-agent-ready-to-implementIssue triage found bounded work ready for an implementation Agent.
    harlan-agent-runningAn Agent holds a Task on this issue or pull request right now.
    and removed
    harlan-agent-runningAn Agent holds a Task on this issue or pull request right now.
    on Oct 8, 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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions