-
Notifications
You must be signed in to change notification settings - Fork 1
Optimize #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
DisposableComponentbase 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.
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.
No description provided.