Skip to content

Conversation

@katinthehatsite
Copy link
Contributor

@katinthehatsite katinthehatsite commented May 2, 2024

Related to https://github.com/Automattic/dotcom-forge/issues/6878

Proposed Changes

This PR adds additional app.isReady() check to app.on( 'activate') to ensure that the app is ready before it attempts to create a browser window.

Testing Instructions

  • Pull the changes from this branch locally
  • Run nvm use && npm install && npm start to start the app
  • Press cmd + W on macOS to close the app window but keep the app running
  • Open the app again
  • Confirm there are no errors in the terminal

Notes
I spent some time trying to trigger the error manually but with no luck. It seems that the steps that a user might take to trigger this error would be (since activate event is specifically designed for macOS, it would need to be tested on Mac):

  • Run the application.
  • Close the main window but do not quit the application. (Typically CMD + W on macOS)
  • Click the application icon in the dock to reactivate it.

If you have any good suggestions on how to test this, let me know!

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@katinthehatsite katinthehatsite self-assigned this May 2, 2024
@dcalhoun
Copy link
Member

dcalhoun commented May 2, 2024

👋🏻 @katinthehatsite. I coincidently encountered the test failures blocking this PR. I addressed them in #80 if you have time to review. 🙇🏻 Once that merges, updating this branch with the latest trunk should fix the failing CI checks.

@katinthehatsite
Copy link
Contributor Author

Hye @dcalhoun - thanks for the fix! I approved the PR you mentioned 👍

@sejas
Copy link
Member

sejas commented May 2, 2024

I updated trunk and that fixes the unit tests 👌 .

I also forgot to change the branch, and continued working in other issue. I pushed a commit and then reverted it 😅 , sorry for the noise.

@katinthehatsite katinthehatsite requested a review from a team May 3, 2024 14:27
Copy link
Contributor

@wojtekn wojtekn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works fine, and the code change looks clear. Thanks for the fix.

@wojtekn wojtekn merged commit 6c0d86d into trunk May 6, 2024
@wojtekn wojtekn deleted the fix/app-error-create-browser-window branch May 6, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants