Skip to content

Conversation

@guimard
Copy link
Member

@guimard guimard commented Nov 28, 2025

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements multiple performance optimizations across the LDAP backend and browser components, focusing on reducing redundant operations and improving resource management.

Key changes:

  • RegEx compilation caching to avoid repeated compilation of validation patterns
  • LDAP connection pool refactored from O(n) polling to O(1) queue-based management with direct handoff
  • Browser component lifecycle management via new DisposableComponent base class for automatic cleanup

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/plugins/ldap/groups.ts Adds regex caching via getCompiledRegex() and escapeRegex() methods to optimize validation logic
src/abstract/ldapFlat.ts Implements same regex caching pattern as groups plugin for consistent validation performance
src/lib/ldapActions.ts Refactors connection pool from polling-based to queue-based with separate available connections tracking and attribute signature caching
src/browser/shared/components/DisposableComponent.ts New base class providing automatic cleanup of event listeners and intervals for browser components
src/browser/shared/components/Modal.ts Extends DisposableComponent to ensure proper cleanup of event listeners, especially document-level keydown handler
src/browser/ldap-user-editor/components/UserTree.ts Extends DisposableComponent to ensure interval cleanup for cache maintenance

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

guimard and others added 3 commits January 17, 2026 19:03
The document.keydown listener was never removed, causing accumulation
across multiple modal instances. Now properly cleaned up via destroy().

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Modal.ts: Call super.destroy() before nullifying overlay
- ldapActions: Add 30s timeout for waiting pool requests
- ldapActions: Check TTL on release to discard expired connections

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add isCleaningUp flag to prevent concurrent cleanupExpiredConnections()
calls, addressing Copilot review comment about potential race conditions.
@guimard guimard merged commit 81d6cd1 into master Jan 17, 2026
5 checks passed
@guimard guimard deleted the optimize branch January 17, 2026 20:29
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.

2 participants