-
Notifications
You must be signed in to change notification settings - Fork 208
feat(auto-updater): Error when requesting updates from an outdated MacOS machine COMPASS-9081 #6851
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
7ba33c2
to
1b962c9
Compare
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.
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- packages/compass/package.json: Language not supported
1b962c9
to
d88461c
Compare
d88461c
to
7cdc3eb
Compare
description: 'Downloading a newer Compass version failed', | ||
description: | ||
reason === 'outdated-operating-system' | ||
? 'The version of your operating system is no longer supported.' |
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.
Maybe a link to the docs install page where we list minimal reqs? This one https://www.mongodb.com/docs/compass/current/install/
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 wonder if that would be clickable? 🤔
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.
We have both buttons and links in toasts in some places in Compass, if you render it as a link, it should be clickable
message: 'There are currently no updates available.', | ||
message: | ||
updateInfo.reason === 'outdated-operating-system' | ||
? `The version of your operating system is no longer supported. Expected at least v${updateInfo.expectedVersion}` |
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 would maybe run this through product. Personally I'm not sure how common it is to prefix an OS version with v
and it caught my eye 🙂 Maybe we can do a better wording here and also link to the docs (same link I mentioned above)
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.
A link here wouldn't be clickable, in which case a button on the message box would be better? 🤔
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.
Oh, right, it's a native box, skipped my mind. Hmmm, yeah, not sure, can try a button for this, but might be slightly weird too 🤔
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.
(Don't want to overcomplicate this too, so your call if it's too much extra effort)
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 added a button - it seems better to me 👍
assert( | ||
typeof json === 'object' && json !== null, | ||
'Expected response to be an object' | ||
); | ||
if ('reason' in json && json.reason === 'outdated-operating-system') { | ||
assert( | ||
'expectedVersion' in json, | ||
"Expected 'expectedVersion' in response" | ||
); | ||
const { expectedVersion } = json; | ||
assert( | ||
typeof expectedVersion === 'string', | ||
"Expected 'expectedVersion' in response" | ||
); | ||
return { | ||
available: false, | ||
reason: 'outdated-operating-system', | ||
expectedVersion, | ||
}; |
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.
Nit: you have a custom catch for the response assertion below, but not here. If we think it's worth having custom logging for the one below, it's probably worth here too?
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 added a try-catch around this parsing with a message that add a bit more context 👍
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.
Didn't have a chance to run this code myself, but reading through it looks good (only small nit about error handling)! I would probalby double-check that copy looks okay to product
I've added links to the system requirements and updated the screenshots accordingly 👍 |
Merging as @betsybutton gave a LGTM on Slack 👍 |
Description
Merging this PR will:
'outdated-operating-system'
the updater will transition to a newOutdatedOperatingSystem
state.After manual check
After automatic or manual check
You can verify the behaviour introduced with this PR by running Compass locally on a Mac passing a fake version (to bypass the skip in the update server) and update server endpoint:
Use this with the update server from https://github.com/10gen/compass-mongodb-com/pull/129 updating the
MINIMUM_MACOS_VERSION
to a future version of MacOS ("20.0.0" or something).Checklist
Motivation and Context
Open Questions
Dependents
Types of changes