Skip to content

Commit fc52bab

Browse files
authored
feat(compass): show the autoupdate installed toast even when we downgrade COMPASS-8808 (#6612)
* Show the autoupdate installed toast even when we downgrade * add data-testids to the toasts needed for testing
1 parent ae127af commit fc52bab

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/compass/src/app/components/update-toasts.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const RestartCompassToastContent = ({
5353
<button
5454
className={cx(buttonStyles, darkmode && buttonDarkStyles)}
5555
onClick={onUpdateClicked}
56+
data-testid="auto-update-restart-button"
5657
>
5758
Restart
5859
</button>
@@ -83,6 +84,7 @@ export function onAutoupdateExternally({
8384
Compass features.
8485
</Body>
8586
<Link
87+
data-testid="auto-update-download-link"
8688
as="a"
8789
target="_blank"
8890
href={'https://www.mongodb.com/try/download/compass'}
@@ -137,6 +139,7 @@ export function onAutoupdateInstalled({ newVersion }: { newVersion: string }) {
137139
title: `Compass ${newVersion} installed successfully`,
138140
description: (
139141
<Link
142+
data-testid="auto-update-release-notes-link"
140143
as="a"
141144
target="_blank"
142145
href={`https://github.com/mongodb-js/compass/releases/tag/v${newVersion}`}

packages/compass/src/app/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,15 @@ const app = {
379379
});
380380
}
381381

382+
log.info(mongoLogId(1_001_000_338), 'Main Window', 'Recent version info', {
383+
previousVersion: state.previousVersion,
384+
highestInstalledVersion: state.highestInstalledVersion,
385+
APP_VERSION,
386+
});
387+
382388
if (
383-
semver.gt(APP_VERSION, state.previousVersion) &&
384-
state.previousVersion !== DEFAULT_APP_VERSION
389+
state.previousVersion !== DEFAULT_APP_VERSION &&
390+
APP_VERSION !== state.previousVersion
385391
) {
386392
// Wait a bit before showing the update toast.
387393
setTimeout(() => {

0 commit comments

Comments
 (0)