-
Notifications
You must be signed in to change notification settings - Fork 2
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: add file sync daemon error handling to the UI #122
Conversation
f7f2242
to
9025d6d
Compare
032237c
to
eb29807
Compare
9025d6d
to
be70ade
Compare
eb29807
to
58c4ff5
Compare
be70ade
to
8d3ca31
Compare
Coder-Desktop/Coder-Desktop/Preview Content/PreviewFileSync.swift
Outdated
Show resolved
Hide resolved
@@ -2,6 +2,8 @@ import VPNLib | |||
|
|||
@MainActor | |||
final class PreviewFileSync: FileSyncDaemon { | |||
var logFile: URL = .init(filePath: "~/log.txt")! |
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.
On Windows we are putting this in $MUTAGEN_DATA_DIR/daemon.log
. It shouldn't go in the home directory
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.
Just a note that when it's a .log
file there most likely isn't an associated program for .log
, so you could either leave it as .txt
e.g. daemon-log.txt
or just open the directory (which is what I'll do on Windows)
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.
That's a class for mocking previews, but in the real class it's going in $MUTAGEN_DATA_DIR/daemon.log
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.
Oh, you're right mb. As long as we're not creating a file in ~/
when using the preview version then it's fine.
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.
By default on macOS .log
files are opened in Console.app
28e2003
to
595c010
Compare
58c4ff5
to
6463de0
Compare
595c010
to
4537dbc
Compare
If file sync is working, but a session has errored, an icon will be displayed on the main menu.


e.g. for:
This icon & tooltip are displayed:
If file sync is not working altogether, due to the daemon crashing, the same icon will be displayed with a different tooltip on hover:

Once the config menu is opened, an alert is displayed, and the daemon log file is opened.

From there, the Daemon can be restarted, or the alert can be dismissed without restarting. The latter provides users an out if the daemon were to crash on launch repeatedly.