-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
fix case where websocket collision crashes frames #227
base: main
Are you sure you want to change the base?
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.el
but can also be triggered with the following steps if using DOOM emacs, and emacs daemon.emacsclient -c
emacsclient -c
In 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.