Skip to content
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

Merged
merged 2 commits into from
Apr 2, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Mar 26, 2025

If file sync is working, but a session has errored, an icon will be displayed on the main menu.
e.g. for:
image
This icon & tooltip are displayed:
image

If file sync is not working altogether, due to the daemon crashing, the same icon will be displayed with a different tooltip on hover:
image

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

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.

@ethanndickson ethanndickson marked this pull request as ready for review March 26, 2025 06:11
@ethanndickson ethanndickson self-assigned this Mar 26, 2025
@ethanndickson ethanndickson force-pushed the ethan/fsd-error-handling branch 2 times, most recently from f7f2242 to 9025d6d Compare March 26, 2025 12:43
@ethanndickson ethanndickson force-pushed the ethan/create-delete-grpc branch from 032237c to eb29807 Compare March 27, 2025 03:06
@ethanndickson ethanndickson force-pushed the ethan/fsd-error-handling branch from 9025d6d to be70ade Compare March 27, 2025 03:06
@ethanndickson ethanndickson force-pushed the ethan/create-delete-grpc branch from eb29807 to 58c4ff5 Compare March 27, 2025 07:43
@ethanndickson ethanndickson force-pushed the ethan/fsd-error-handling branch from be70ade to 8d3ca31 Compare March 27, 2025 07:43
@@ -2,6 +2,8 @@ import VPNLib

@MainActor
final class PreviewFileSync: FileSyncDaemon {
var logFile: URL = .init(filePath: "~/log.txt")!
Copy link
Member

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

Copy link
Member

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)

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

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

@ethanndickson ethanndickson changed the base branch from ethan/create-delete-grpc to graphite-base/122 March 28, 2025 02:54
@ethanndickson ethanndickson force-pushed the ethan/fsd-error-handling branch from 28e2003 to 595c010 Compare March 28, 2025 02:56
@graphite-app graphite-app bot changed the base branch from graphite-base/122 to main March 28, 2025 02:57
Copy link
Member Author

ethanndickson commented Apr 2, 2025

Merge activity

  • Apr 1, 11:15 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Apr 1, 11:15 PM EDT: A user merged this pull request with Graphite.

@ethanndickson ethanndickson merged commit ff033e1 into main Apr 2, 2025
4 checks passed
@ethanndickson ethanndickson deleted the ethan/fsd-error-handling branch April 2, 2025 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants