fix case where websocket collision crashes frames#227
fix case where websocket collision crashes frames#227cuttlefisch wants to merge 7 commits intoorg-roam:mainfrom
Conversation
|
Updated the PR to use a function called |
Calls to some of the process-* functions when `org-roam-ui-mode` is nil results in the target process evaluating to that of the current buffer. The result is failed server startup/shutdown under certain common conditions.
|
This is ready for more thorough testing by others. There was some unexpected behavior which turned out to be a result of the process library's treatment of a The proposed solution is to prevent calls which would act on |
The Issue
Mentioned in #202, there is a case where successive calls to enable org-roam-ui-mode causes an address collision due to the websocket-server call triggering with each request to activate the mode.
This appears to happen with
desktop.elbut can also be triggered with the following steps if using DOOM emacs, and emacs daemon.emacsclient -cemacsclient -cIn this case the behavior is a result of doom's theme-specific hooks resulting in successive calls of
(org-roam-ui-mode 1), which cause the websocket-server failure.Proposed solution
This PR creates a new custom variable to track the state of the webserver: t if running & nil if not. A call to enable the mode only launches the websocket-server if the server is not already running. If the server was already running at the time of the call, log to the Message buffer that the server was already running.