-
Notifications
You must be signed in to change notification settings - Fork 105
Description
Hello, I'm reporting two critical bugs I've encountered while using TFT Hextech Helper:
- Game detection failure on macOS - The application fails to detect the League of Legends client on macOS systems, preventing it from working at all on macOS.
- Application freezing when game loads - The app becomes completely unresponsive after the game client loads into a match, requiring a force-quit.
Bug #1: Game Detection Failure on macOS
Description
The application is unable to detect the League of Legends client when running on macOS. After launching the League client and then launching TFT Hextech Helper, the app continuously reports that the client is not detected and never establishes a connection.
Environment
- OS: macOS (tested on macOS 14+ with Apple Silicon)
- League Client: Latest version
- Application Version: 0.1.0
- Architecture: arm64 (Apple Silicon)
Steps to Reproduce
- Launch League of Legends client on macOS (ensure it's fully logged in)
- Launch TFT Hextech Helper application
- Wait for client detection - it never happens
- Check console logs - you'll see repeated "LOL客户端未启动,一秒后将再次检查..." messages indefinitely
Expected Behavior
The application should detect the League client within 1-2 seconds after launch and establish an LCU connection, similar to how it works on Windows.
Actual Behavior
- The application continuously polls for the client but never successfully detects it
- Console shows repeated "client not found" messages
- The app never progresses past the initial connection phase
- No error messages explaining why detection fails
Technical Details Observed
I investigated the issue and found the problem appears to be in the process detection logic. The getLCUInfoFromProcess() method in src-backend/lcu/utils/LcuConnector.ts seems to have issues on macOS:
-
Process command returns multiple processes: When running
ps x -o args | grep 'LeagueClientUx'on macOS, it returns multiple processes (the main LeagueClientUx process plus helper processes like GPU, Renderer, Utility helpers, etc.), and the code doesn't properly filter to find just the main process. -
Regex pattern issue with paths: The regex pattern for extracting
--install-directoryexpects quoted paths (like"--install-directory=/path"), but on macOS the process command line doesn't use quotes around the path value. Additionally, macOS paths can contain spaces (e.g.,/Applications/League of Legends.app/Contents/LoL), which the current regex pattern--install-directory=(.*?)"doesn't handle because it stops at the first space. -
Grep command self-match: The grep command itself can appear in the process list, adding noise to the output that needs to be filtered out.
Steps to Reproduce
- Launch League of Legends client on macOS
- Launch TFT Hextech Helper application
- Observe that the app never detects the client connection
- Check console logs - you'll see repeated "LOL客户端未启动,一秒后将再次检查..." messages
Expected Behavior
The application should detect the League client within 1-2 seconds and establish an LCU connection.
Actual Behavior
The application continuously polls for the client but never successfully parses the process information, resulting in indefinite "client not found" messages.
Suggested Fix
Based on my investigation, here are potential fixes that might resolve the issue:
-
Improve process filtering: Update the process detection command to use
grep '[L]eagueClientUx'(the[L]bracket trick prevents grep from matching itself) and filter out helper processes by checking for--type=parameter orFrameworksin the process path. -
Fix regex for install directory: Update the regex pattern to handle unquoted paths with spaces. A pattern like
/--install-directory=(.+?)(?=\s+--|$)/would match from--install-directory=until the next--parameter or end of line, handling both quoted and unquoted paths. -
Better error logging: Add more detailed logging to help debug when process detection fails, such as logging the raw process output and which regex matches succeeded/failed.
Code Location
- File:
src-backend/lcu/utils/LcuConnector.ts - Method:
static getLCUInfoFromProcess() - Lines: Approximately 61-109
Bug #2: Application Freezing When Game Loads
Description
After successfully detecting the client and starting a match, the application becomes completely unresponsive when the game loads into the match. The UI freezes completely and the application stops responding to any user input. This occurs right when transitioning from the loading screen into the actual game.
Environment
- OS: macOS / Windows (observed on both platforms)
- Application Version: 0.1.0
- Trigger: When the game client finishes loading and transitions into the match (when
GameLoadingStatetransitions toGameRunningState)
Steps to Reproduce
- Launch League of Legends client
- Launch TFT Hextech Helper application (ensure client is detected)
- Start the helper and let it create a lobby and queue for a match
- Accept the match when found
- Wait for champion select to complete
- Game loads into the match
- Bug occurs: Application UI completely freezes, becomes unresponsive immediately upon game load
Expected Behavior
The application should continue running smoothly, monitoring game stages and executing strategies without any freezing or performance issues. The UI should remain responsive throughout the match.
Actual Behavior
- Application UI becomes completely frozen/unresponsive
- No error messages appear in the console (or errors are not being logged)
- Application appears to hang/freeze completely
- User must force-quit the application to recover
- This happens consistently - it's reproducible every time
Investigation Notes
I've observed that the freeze occurs specifically when the game loads into the match, which corresponds to the transition from GameLoadingState to GameRunningState. Possible causes could include:
-
Blocking operations: Heavy operations like screen capture or OCR processing might be blocking the main thread, causing the UI to freeze.
-
Event listener issues: Multiple event listeners may be registered without proper cleanup, or there could be event listener leaks that cause issues.
-
Promise/async issues: A promise might be hanging indefinitely (e.g.,
waitForGameToEnd()waiting for an event that never arrives), causing the application to become unresponsive. -
Resource-intensive operations: Screen capture and OCR operations that start when the game loads might be too resource-intensive and blocking the main thread.
Code Locations That May Need Investigation
Based on when the freeze occurs, these areas might be worth investigating:
src-backend/states/GameRunningState.ts- Theaction()method andwaitForGameToEnd()promisesrc-backend/services/GameStageMonitor.ts- Screen capture and polling logic that starts when game loadssrc-backend/services/StrategyService.ts- Event subscription logicsrc-backend/tft/recognition/ScreenCapture.ts- Screen capture operationssrc-backend/tft/recognition/OcrService.ts- OCR processing operations
Suggested Fixes
These are suggestions based on the symptoms - you'll know best how to fix them:
-
Make operations non-blocking: Ensure all heavy operations (screen capture, OCR) are properly async/await and not blocking the main thread. Consider using Web Workers for CPU-intensive operations.
-
Add timeouts and error handling: Add timeouts to promises that wait for events (like
waitForGameToEnd()), and ensure all operations are wrapped in try-catch blocks to prevent unhandled errors from freezing the app. -
Improve resource management: Ensure proper cleanup of event listeners and resources when transitioning states. Check for memory leaks.
-
Add logging: Add comprehensive logging around the transition from
GameLoadingStatetoGameRunningStateto identify exactly where the freeze occurs. -
Optimize screen capture/OCR: If screen capture or OCR operations are too resource-intensive, consider optimizing them or reducing their frequency.
Additional Context
System Information
- OS: macOS 14.x (Apple Silicon), also observed on Windows 10/11
- Electron Version: 32.2.2 (from package.json)
- Architecture: arm64 (Apple Silicon) / x64
Additional Notes
- Bug Game Detection Failure on macOS and App Freezing During Game Load #1 (macOS detection) completely prevents the app from working on macOS, making it unusable for macOS users.
- Bug 检测不到客户端 #2 (freezing) makes the app unusable after starting a match, even though it works fine up until that point.
- Both bugs are reproducible consistently.
Logs
Unfortunately, I don't have detailed console logs available at the moment, but I can provide them if needed. The main observable symptoms are:
- For Bug Game Detection Failure on macOS and App Freezing During Game Load #1: Repeated "LOL客户端未启动,一秒后将再次检查..." messages in console
- For Bug 检测不到客户端 #2: Application freezes with no error messages appearing
Priority
High - Both bugs are critical and prevent the application from functioning:
- Bug Game Detection Failure on macOS and App Freezing During Game Load #1: Prevents all functionality on macOS (affects all macOS users)
- Bug 检测不到客户端 #2: Prevents application from working after match starts (affects all users after they get into a game)
Request
Please investigate and fix these issues. They are blocking core functionality of the application. If you need any additional information, logs, or system details, please let me know and I'll be happy to provide them.
Thank you for your time and for developing this helpful tool!