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

Patch: switch from node-ipc to ws #4185

Merged
merged 4 commits into from
Apr 23, 2024
Merged

Patch: switch from node-ipc to ws #4185

merged 4 commits into from
Apr 23, 2024

Conversation

aethernet
Copy link
Contributor

This PR does 2 things (on top )

  • switch api communication from node-ipc to ws
  • invert the client/server roles (flasher is now the server and gui the client)

This makes debugging the flasher way easier and further decouple the flasher and gui, which open up the road to a standalone flasher and other cool features.

@dfunckt
Copy link
Member

dfunckt commented Mar 11, 2024

Looks great overall @aethernet. Iterate on this as much as you need and merge at will.

lib/shared/sudo/linux-sudo.ts Fixed Show resolved Hide resolved
@aethernet aethernet force-pushed the reverse-control-flow branch 5 times, most recently from 36cbcd9 to bab630f Compare March 21, 2024 09:05
@aethernet aethernet force-pushed the reverse-control-flow branch 6 times, most recently from 1e97f88 to 15e47ed Compare March 29, 2024 13:15
@aethernet aethernet force-pushed the reverse-control-flow branch 2 times, most recently from 5e2dfac to 2d594f6 Compare April 22, 2024 12:21
@aethernet
Copy link
Contributor Author

A little rough on the edge, but should be good to go for a pre-release test

lib/gui/app/modules/api.ts Outdated Show resolved Hide resolved
lib/gui/app/modules/api.ts Outdated Show resolved Hide resolved
lib/gui/app/modules/api.ts Show resolved Hide resolved
lib/gui/app/modules/image-writer.ts Outdated Show resolved Hide resolved
lib/shared/sudo/catalina-sudo.ts Outdated Show resolved Hide resolved
lib/util/api.ts Outdated Show resolved Hide resolved
lib/util/api.ts Outdated Show resolved Hide resolved
lib/util/api.ts Outdated Show resolved Hide resolved
lib/util/api.ts Outdated Show resolved Hide resolved
lib/util/api.ts Outdated Show resolved Hide resolved
lib/shared/sudo/linux.ts Dismissed Show dismissed Hide dismissed
Copy link
Member

@dfunckt dfunckt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides fixing the formatting issues which would cause unnecessary changes to be included in future PRs, my other comments aren’t critical, it’s looking fine.

lib/gui/app/modules/api.ts Show resolved Hide resolved
lib/gui/app/modules/api.ts Show resolved Hide resolved
lib/gui/app/modules/image-writer.ts Outdated Show resolved Hide resolved
lib/gui/app/modules/image-writer.ts Outdated Show resolved Hide resolved
lib/shared/permissions.ts Outdated Show resolved Hide resolved
@aethernet aethernet force-pushed the reverse-control-flow branch 3 times, most recently from 0aeb805 to f439ee1 Compare April 23, 2024 08:48
@aethernet aethernet requested a review from dfunckt April 23, 2024 08:57
Copy link
Member

@dfunckt dfunckt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few more comments focusing on clarity more than anything. Looks good otherwise.

lib/gui/app/modules/api.ts Show resolved Hide resolved
lib/gui/app/modules/image-writer.ts Outdated Show resolved Hide resolved
lib/shared/sudo/linux.ts Outdated Show resolved Hide resolved
lib/shared/sudo/windows.ts Outdated Show resolved Hide resolved
lib/util/api.ts Outdated Show resolved Hide resolved
lib/util/api.ts Outdated Show resolved Hide resolved
}

/**
* @summary Handle `errors`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these doc strings don’t seem to add much besides noise. Delete them? Unless you feel like there’s subtleties in each function that you need to surface as a comment, in which case by all means do so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a tendency to over-comment. It's like using your turn signal in the middle of the night, all alone on the highway; it doesn't do anything, but it's a reflex, and I prefer to do it when it's not needed rather than risk not doing it when it would be necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I'm happy to remove them if you feel strongly about it :)

Copy link
Member

@dfunckt dfunckt Apr 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not offended to see them, but if optimizing for readability is a worthy goal then comments that don’t offer valuable information have no place in the code base because they contribute to noise.

- switch api roles flow
- use websocket instead of node-ipc
- integrate; modernize; simplify and deprecate sudo-prompt
@flowzone-app flowzone-app bot merged commit 0a243ca into master Apr 23, 2024
50 checks passed
@flowzone-app flowzone-app bot deleted the reverse-control-flow branch April 23, 2024 10:27
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.

None yet

2 participants