fix engine card refresh, remove-by-id and shutdown guards#110
Open
nghiphaam wants to merge 2 commits into
Open
fix engine card refresh, remove-by-id and shutdown guards#110nghiphaam wants to merge 2 commits into
nghiphaam wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
appServer (Electron + engine server) fixes:
ui/index.jsrefreshEngineCards: engine ids are sha256 hex strings, but cards were compared viaNumber(...)which is alwaysNaN, soactivewas removed from every card regardless of which engines were alive. Now compares as strings. Also dropped a leftoverconsole.log.indexcaptured in the card's click handler, butrenderEngineGridonly appends new cards, so after a removal (which splices the array) surviving cards kept stale indices and could remove the wrong engine.removeEnginenow takes anengineIdand looks up the current index itself (engine.js,main.js,preload.js,ui/index.js).engine.js: theclosehandler (engine self-terminating) removed the alive engine object but never calledrefreshEngineCards, so the card stayed "active"; it now refreshes. Removed a duplicateremoveConsoleViewcall inkillSpecificEngine.engine.js/util.js: the renderer-send helpers (renderEngineGrid,addConsoleView,removeConsoleView,refreshEngineCards,log,toast) dereferencedmainWindow.webContentswith no guard and could throw during shutdown when engines close. They now go through a guarded helper that checksmainWindow.isDestroyed().