- Notifications
You must be signed in to change notification settings - Fork24
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
4caf765
tod06c873
CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
What's the easiest way to test these changes locally@kylecarbs ? |
Uh oh!
There was an error while loading.Please reload this page.
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
Uh oh!
There was an error while loading.Please reload this page.
@deansheather re: testing Let me make these changes, build to a |
This removes the version from the binary path to ensure that the pathalways remains the same on OS's.This way, tools like Windows Firewall and macOS Firewill will onlyprompt for a security check on the first install but not subsequentinstalls.
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. Ifit is, then it downloads the latest version.
36da848
to369a823
Comparejsjoeio commentedJan 18, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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 ishandy 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 appendsit to the headers. This also adds some logging around etag, binPath andstatus 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
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Dean Sheather <dean@deansheather.com>
Co-authored-by: Dean Sheather <dean@deansheather.com>
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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!
Uh oh!
There was an error while loading.Please reload this page.
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 forETag 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