Skip to content

Conversation

@charlesvien
Copy link
Contributor

@charlesvien charlesvien commented Jan 17, 2026

Alright here's what I found in the cave...

the bug: when autoUpdater.quitAndInstall() was invoked, it triggered the before-quit event, but the handler would intercept it, prevent the default behavior, and forcibly exit the app before the updater could complete its installation flow.

solution: this PR introduces a new AppLifecycleService that centralizes all shutdown logic and tracks an isQuittingForUpdate flag. Now when installing an update, the UpdatesService first calls lifecycleService.shutdown() to gracefully clean up, then sets lifecycleService.setQuittingForUpdate() before calling quitAndInstall(). The before-quit handler now checks this flag and returns early if set, allowing the auto updater to proceed unblocked. This separates the "normal quit with cleanup" path from the "quit for update" path

NOTE: There is a different event sequence for quitAndInstall()

Excerpt taken from electron docs

The Event Sequence for quitAndInstall()

Normal quit:

  1. before-quit emitted
  2. Windows receive close events
  3. Windows close
  4. will-quit emitted
  5. App exits

quitAndInstall() sequence (different!):

  1. All windows receive close events first
  2. Windows close
  3. before-quit emitted after windows are closed
  4. Installer runs

@charlesvien charlesvien changed the title Implement AppLifecycleService and refactor to fix auto updater feat: Implement AppLifecycleService and refactor to fix auto updater Jan 17, 2026
Copy link
Contributor Author

charlesvien commented Jan 17, 2026

@charlesvien charlesvien changed the title feat: Implement AppLifecycleService and refactor to fix auto updater feat: Implement AppLifecycleService and refactor to fix auto updater Jan 17, 2026
@charlesvien charlesvien changed the base branch from main to graphite-base/530 January 17, 2026 08:44
@charlesvien charlesvien force-pushed the 01-16-implement_applifecycleservice_and_refactor_to_fix_auto_updater branch from 4d88993 to 3bde2b0 Compare January 17, 2026 08:44
@charlesvien charlesvien changed the base branch from graphite-base/530 to 01-17-fix_ci_cd_pipeline_trying_to_double_release_on_commits_to_main January 17, 2026 08:44
@charlesvien charlesvien force-pushed the 01-17-fix_ci_cd_pipeline_trying_to_double_release_on_commits_to_main branch from 4d87684 to feb4482 Compare January 17, 2026 21:37
Base automatically changed from 01-17-fix_ci_cd_pipeline_trying_to_double_release_on_commits_to_main to main January 17, 2026 22:51
@charlesvien charlesvien changed the base branch from main to graphite-base/530 January 17, 2026 22:59
@charlesvien charlesvien force-pushed the 01-16-implement_applifecycleservice_and_refactor_to_fix_auto_updater branch from 3bde2b0 to 7b678df Compare January 17, 2026 22:59
@charlesvien charlesvien changed the base branch from graphite-base/530 to 01-17-configure_the_git_identity_in_the_new_tag_workflow January 17, 2026 22:59
Base automatically changed from 01-17-configure_the_git_identity_in_the_new_tag_workflow to main January 18, 2026 03:18
@charlesvien charlesvien force-pushed the 01-16-implement_applifecycleservice_and_refactor_to_fix_auto_updater branch from 7b678df to 97bc3d0 Compare January 19, 2026 16:52
@charlesvien
Copy link
Contributor Author

#528

@charlesvien charlesvien force-pushed the 01-16-implement_applifecycleservice_and_refactor_to_fix_auto_updater branch 2 times, most recently from c2295c1 to da9e88b Compare January 20, 2026 06:00
@charlesvien charlesvien marked this pull request as ready for review January 20, 2026 06:21
@charlesvien charlesvien requested a review from a team as a code owner January 20, 2026 06:21
Copy link
Contributor

@k11kirky k11kirky left a comment

Choose a reason for hiding this comment

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

LGTM

@charlesvien charlesvien force-pushed the 01-16-implement_applifecycleservice_and_refactor_to_fix_auto_updater branch from da9e88b to 7347cf0 Compare January 20, 2026 22:12
@charlesvien
Copy link
Contributor Author

This should also address "Point 5: Manual Update Issue" on the Array Feedback PDF

Copy link
Contributor Author

charlesvien commented Jan 21, 2026

Merge activity

  • Jan 21, 5:35 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 21, 5:35 AM UTC: @charlesvien merged this pull request with Graphite.

@charlesvien charlesvien merged commit 844e1f4 into main Jan 21, 2026
12 checks passed
@charlesvien charlesvien deleted the 01-16-implement_applifecycleservice_and_refactor_to_fix_auto_updater branch January 21, 2026 05:35
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.

3 participants