Skip to content

Open restart nudge if user triggers update check after closing it - #353

Merged
wojtekn merged 1 commit into
trunkfrom
fix/manual-updates-after-user-chooses-later
Jul 15, 2024
Merged

Open restart nudge if user triggers update check after closing it#353
wojtekn merged 1 commit into
trunkfrom
fix/manual-updates-after-user-chooses-later

Conversation

@wojtekn

@wojtekn wojtekn commented Jul 11, 2024

Copy link
Copy Markdown
Contributor

Related to #277

Proposed Changes

When there is a new Studio version, Studio asks if user wants to upgrade. If they choose 'Later', and then try using 'Check for Updates' option, nothing will happen.

I propose to add a restart nudge in such a case to ensure that users get feedback when they use 'Check for Updates' again.

Testing Instructions

  1. Apply patch to simulate downloading restart:
diff --git a/src/updates.ts b/src/updates.ts
index 504b48a..27ec600 100644
--- a/src/updates.ts
+++ b/src/updates.ts
@@ -48,6 +48,10 @@ export function setupUpdates() {
 	} );
 
 	autoUpdater.on( 'update-not-available', async () => {
+		updaterState = 'waiting-for-restart';
+		console.log( 'Faking downloading new version' );
+		return await showUpdateReadyToInstallNotice();
+
 		if ( showManualCheckDialogs ) {
 			await showUpdateUnavailableNotice();
 		}

  1. Start Studio npm start
  2. Click 'Check for Updates'
  3. Confirm that dialog was displayed and 'Faking downloading new version' was logged
  4. Click 'Later'
  5. Click 'Check for Updates'
  6. Confirm that dialog was displayed and 'Update has been already downloaded, proposing to restart again' was logged

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@wojtekn
wojtekn requested a review from a team July 11, 2024 10:59
@wojtekn wojtekn self-assigned this Jul 11, 2024
@katinthehatsite

Copy link
Copy Markdown
Contributor

I tested this against the flow on trunk and I think the user experience is better with this implementation.

@wojtekn
wojtekn merged commit 9208bd4 into trunk Jul 15, 2024
@wojtekn
wojtekn deleted the fix/manual-updates-after-user-chooses-later branch July 15, 2024 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants