-
Notifications
You must be signed in to change notification settings - Fork 245
feat: implement HADRON_ISOLATED through preferences COMPASS-6065 #3503
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
- Implement `HADRON_ISOLATED` through the `networkTraffic` preference. - Derive the value of other preferences that are shadowed by `networkTraffic` through a generic mechanism for doing so (we will also need this for `readOnly`/`enableShell`) - Add an e2e test that runs on Linux and verifies via `strace` that Compass does not actually perform external network I/O when `--no-network-traffic` has been specified.
| (k) => | ||
| (k as unknown) === key ? originalStates[k] : deriveValue(k).state | ||
| ); | ||
| } |
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.
@alenakhineika I don’t think we specified in the tech design how networkTraffic interacts with the individual preference values. I chose to use a generic mechanism for this rather than hardcoding the preference names and their interactions, also considering that for enableShell and readOnly we are going to have to do something similar again.
|
|
||
| const preferences2 = new Preferences(tmpdir); | ||
| const fetchResult2 = await preferences2.fetchPreferences(); | ||
| expect(fetchResult2.autoUpdates).to.equal(true); // (!) |
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.
Left // (!) comments here because the behavior might be surprising, I think it’s the least surprising one of all different options though.
| return { | ||
| label: '&Settings', | ||
| accelerator: 'Command+,', | ||
| accelerator: 'CmdOrCtrl+,', |
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.
I also want to be able to use a shortcut on non-macOS platforms 😌
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.
One thing caught my attention when trying out the feature locally: I see that in tech design networkTraffic is marked as available in settings UI, are you planning to add it there in the same PR or in a separate one? (I looked through the tickets, but couldn't find a separate ticket for something like that)
|
@gribnoysup Just had a conversation with Claudia and Alena about that, we’re not planning to explicitly add a checkbox to the settings UI for |
gribnoysup
left a comment
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.
Worth marking in the tech design maybe just so we have this decision documented? Otherwise looks good to me, that's an amazing feature we are building here!
One thing that does slightly bother me is that our preferences class is now re-implementing some of the ampersand models behavior, which I think is okay as a one-off thing here, but if we find ourselves doing this again, I would maybe give it another thought if we want to just use them for now instead of re-implementing them 🤔
HADRON_ISOLATEDthrough thenetworkTrafficpreference.networkTrafficthrough a generic mechanism for doing so (we will also need this forreadOnly/enableShell)stracethat Compass does not actually perform external network I/O when--no-network-traffichas been specified.Description
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes