Skip to content

Fix Event Listener Cleanup (8 test failures) #264

Closed

Description

@malibio

Bug: Event Listener Cleanup Failures

Related to: Issue #208 (Comprehensive Test Coverage)
Test File: src/tests/integration/event-listener-cleanup.test.ts
Failures: 8 tests

Problem

Event listener cleanup tests failing - potential memory leaks in NodeAutocomplete and SlashCommandDropdown components during rapid mount/unmount cycles.

Failing Tests

NodeAutocomplete (3 tests)

  • should remove keydown listener when NodeAutocomplete unmounts
  • should not accumulate listeners over multiple mount/unmount cycles
  • should cleanup listeners during normal unmount lifecycle

SlashCommandDropdown (1 test)

  • should remove keydown listener when SlashCommandDropdown unmounts

Rapid Operations (4 tests)

  • should handle 100 rapid mount/unmount cycles without leaking
  • should maintain acceptable memory usage during rapid operations
  • should detect leaked listeners programmatically
  • should return listener count to baseline after rapid operations

Acceptance Criteria

  • All 8 tests pass
  • No memory leaks during rapid mount/unmount
  • Listener count returns to baseline
  • Quality checks pass: bun run quality:fix

Testing

Run: bun run test src/tests/integration/event-listener-cleanup.test.ts

Activity

  1. malibio commented on Oct 17, 2025

    @malibio
    CollaboratorAuthor

    ✅ All tests passing after #274 textarea migration.

    The event listener cleanup tests were in deleted test files (focus-management.test.ts, event-listener-cleanup.test.ts) that were specific to the contenteditable implementation.

    The new textarea implementation has simpler event handling that doesn't require the complex cleanup patterns that were causing failures.

    Current status: 813/814 tests passing (99.9%)

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