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
Updating to electron 8 #4295
Comments
I think setting cwd in initial ui state and filtering undefined values should both be done for this. |
Setting cwd ourselves ensures that the behaviour of every later action is the same as before, so I think that's the safest way as well? |
I agree, I suggested filtering undefined also as if any plugin triggers the session_set_cwd action with undefined then I think workingDirectory should be used, or is that too many fallbacks and might not really happen irl |
Yeah, I don't have a good insight into what plugins do these days but we might just also tell them if they do that to help their debugging |
While trying to put the initial working directory in ui state I am having issues with opening hyper from cli, and the This is true on Windows, but the behaviour is different on mac (don't have linux to test) On using the ui state solution, opening from cli is working in macOs but it's not in Windows (both cli and context menu). This behaviour of cli/context menu seems strange and I'll have to take a deeper look into how it's being done to do the ui state solution, but this will take some time. For now I think we should filter out the undefined keys from the extraOptions object to have the same behaviour as before (tested fine on mac and windows). |
Maybe @chabou can help here, CLI was his baby |
@Stanzilla I think we should go ahead with
|
#4283 is failing because we need newer node-abi also for electron-rebuild to work (see this).
Updating to electron 8 introduces some issues though.
One I've been able to identify is with
cwd
, it's getting set as undefined and thus hyper starts at/
when opened or the hyper git folder during dev withyarn run app
.Explanation:
While creating a new session
https://github.com/zeit/hyper/blob/d0ce94ce8ea690012778069db5deb80d624f73c8/app/ui/window.ts#L135-L136
the
extraOptions
can have these keyssplitDirection, cwd, activeUid, isNewGroup
normallyOut of these, value of
cwd
is alwaysundefined
as it's being taken from ui state which doesn't have cwd initially and theSESSION_SET_CWD
action is not triggered anywhere in the codebase.This didn't cause us any problems earlier as until now the ipc had been removing the keys with
undefined
values and we're using the extraOptions herehttps://github.com/zeit/hyper/blob/d0ce94ce8ea690012778069db5deb80d624f73c8/app/ui/window.ts#L118-L127
So, cwd was always getting set to
workingDirectory
But in electron 8, this behaviour of ipc has changed electron/electron#20214
it now sends the object properly, so now
extraOptions
has thecwd
key withundefined
value, which overwritesworkingDirectory
inObject.assign
thus causing the issue.We can fix this in a number of ways:
Setting the
workingDirectory
value in the initial ui stateFiltering
undefined
values beforeObject.assign
Emitting a
SESSION_SET_CWD
action before the session creation etc.This was one issue which was apparent and I was able to dig into, if I find any more, I'll add it here or create separate issues.
The text was updated successfully, but these errors were encountered: