-
Notifications
You must be signed in to change notification settings - Fork 283
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
feat(workspace/#640): persistence infrastructure + persist workspace and window state #1703
Conversation
So nice to have the window size and position persisted! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the CI is hitting the same issue I saw in #1627 - I worked around it by adding this resolution:
|
Yeah, I saw that and adopted it in revery-ui/revery#826 as well. Will bring it over here once that's merged, unless you've merged #1627 by then. |
Hmm, this seems to fail everywhere except on my computer. Currently building on my Macbook to try there, but could you try this on Windows as well @bryphe ? |
Sure, taking a look - my guess would be that the syntax server is failing to start for some reason - might've been impacted by changes to the cli or logging in |
One of them definitely has an issue with the syntax highlighting, but the rest seem to all fail for different reasons. I'll restart to see if perhaps we can get even more flavors! |
/azp run |
Fun 😄 It seems on OSX, it's failing when running this command
which outputs:
exit code 2 is usually an OCaml exception - so we could try adding |
Same sort of failure on Windows. I think adding that |
I think it's related to not having a ...but it's great that it caught this! |
It seems like in the case where
|
Hmm, shouldn't that be created automatically? And shouldn't some integration test try to exercise user configuration or keybindings or some such? |
It gets created here in
I think the problem is the |
The integration tests do exercise user config and keybindings, but they create separate folders for it (mainly to prevent it from paving a developer's configuration when they run it 😬 ) |
There's really not much happening in
|
Right, that's the complicated override code. It would be better to override the config folder more generally I think, and maybe that'd solve this issue as well. |
In the meantime I can make sure to handle this more gracefully in the Persistence code. Just log an error and continue without actually reading or writing anything. |
It looks like the bug is in the
The function is:
AFAIK, mkdir doesn't let you make a path of nested subdirectories... We need a better Before, we'd And it seems like this could also fail in the case where a user had no |
@reason-native/fs has a |
I tried the latest, and I'm still seeing a crash on WIndows unfortunately. Unfortunately I ran out of time today - I'll continue investigating Monday. In the meantime, one thing we could try splitting up the PR and getting pieces in - could help us localize what change is causing Windows to fail - some ideas:
|
@@ -58,14 +58,16 @@ let printVersion = _cli => { | |||
0; | |||
}; | |||
|
|||
Log.debug("Startup: Parsing CLI options"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I've seen cause crashes on Windows is logging (writing to stdout
/stderr
) before we get a chance to init a console instance (which happens in Cli.parse
, if -f
is specified). But I removed this line, and it didn't fix the crash
03173d1
to
e9a8e2e
Compare
Ok, identified the crash!
Looks like |
Ok, took some time but got it working now - turns out there were a couple blockers... I documented them more thoroughly in a PR to |
Oh, I didn't notice that this is ready to be merged. I was waiting for reason-native to be updated! Thanks @bryphe! |
This adds the necessary persistence infrastructure, as well as global and workspace stores for persisting the following items:
It can be merged as-is, but there's a couple minor issues I'd like to iron out that requires upstream changes:
Edit: Actually, this shouldn't be merged until I've converted the write to use Libuv, as it's currently blocking.
Fixes #640
Fixes #619 - We now fall back to Documents instead
Fixes #906 - We now fall back to Documents, and then ultimately to $HOME
Addresses #639, #1659