-
Notifications
You must be signed in to change notification settings - Fork 24
fix: keep binary in same place, update if needed #33
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
Conversation
4caf765
to
d06c873
Compare
What's the easiest way to test these changes locally @kylecarbs ? |
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.
oops meant to request changes
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.
the logic seems OK but I haven't tested it
@deansheather re: testing Let me make these changes, build to a |
This removes the version from the binary path to ensure that the path always remains the same on OS's. This way, tools like Windows Firewall and macOS Firewill will only prompt for a security check on the first install but not subsequent installs.
This makes significant changes to the `fetchBinary` logic. First, it refactors a couple pieces of logic into methods on the `Storage` class to make the code more readable. Then it modifies the flow to first check if the binary is outdated. If it is, then it downloads the latest version.
36da848
to
369a823
Compare
I'm going to try rebasing on EDIT: same issue |
I figured it out - I was trying to |
This will build a `.vsix` file locally marked as a pre-release which is handy for testing.
This makes a couple new changes: - if 200, move old binPath to binPath.old- - try removing .old binary - on start, cleanUpOldBinaries
- catch all potential errors from `fs` - only rename binPath to old right before replacing with tempFile
This generates the Etag correctly using a readableStream and the appends it to the headers. This also adds some logging around etag, binPath and status code.
@deansheather ready for a new review! |
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.
Looks good and works on Windows for me. The logic seems OK but I'm not a big typescript guy so someone else should approve too
Co-authored-by: Dean Sheather <[email protected]>
Co-authored-by: Dean Sheather <[email protected]>
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.
Really appreciate the comments you left!
Description
@deansheather filed a bug related to the Windows Firewall prompt coming up with every new binary (i.e. every time we download
coder
to an updated version).After some initial testing, it appears keeping the binary in the same place will make the prompt only appear on the first time.
Previous implementation kept the version in the path.
We decided to refactor things to add support for ETag on the server and then use those changes on the client (aka in the extension).
This means now the client will tell the server "Here's the version I have. What should I do?" and send the appropriate headers.
Checklist
If-None-Match
header in your requestTesting Plan
TBD
Fixes #23