Skip to content

Conversation

@Minh141120
Copy link
Member

@Minh141120 Minh141120 commented Aug 14, 2025

This pull request adds logic to disable the auto-updater feature throughout the app when the AUTO_UPDATER_DISABLED flag is set. It ensures that update-related actions and UI elements are hidden or prevented from executing when auto-updates are disabled.

Auto-updater disabling logic:

  • Added early return checks for the AUTO_UPDATER_DISABLED flag in both the checkForUpdate and downloadAndInstallUpdate functions within useAppUpdater.ts, preventing update logic from running if auto-updates are disabled. [1] [2]

UI updates for disabled auto-updater:

  • Updated the General settings page to conditionally render the "Check for Updates" card only when auto-updates are enabled, hiding it if AUTO_UPDATER_DISABLED is true. [1] [2]

Important

Disable auto-updater feature when AUTO_UPDATER_DISABLED flag is set, affecting logic and UI in useAppUpdater.ts and general.tsx.

  • Behavior:
    • Adds checks for AUTO_UPDATER_DISABLED in checkForUpdate and downloadAndInstallUpdate in useAppUpdater.ts, preventing execution if true.
    • Updates General settings page in general.tsx to hide "Check for Updates" card when AUTO_UPDATER_DISABLED is true.
  • Tests:
    • Mocks AUTO_UPDATER_DISABLED in useAppUpdater.test.ts to test new behavior.
    • Updates tests to call checkForUpdate instead of directly setting updateInfo in useAppUpdater.test.ts.

This description was created by Ellipsis for dcb4617. You can customize this summary. It will automatically update as commits are pushed.

@Minh141120 Minh141120 self-assigned this Aug 14, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to 388959a in 1 minute and 56 seconds. Click for details.
  • Reviewed 81 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. web-app/src/hooks/useAppUpdater.ts:156
  • Draft comment:
    AUTO_UPDATER_DISABLED is checked again in downloadAndInstallUpdate without explicit definition. Consider abstracting this check (or ensuring a proper import) to avoid duplication and potential runtime issues.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 30% vs. threshold = 50% The comment raises a valid point about code quality - an undefined constant is being used and there's duplicate logic. However, since AUTO_UPDATER_DISABLED isn't defined in this file, it must be defined elsewhere, likely in a config or constants file. Without seeing where it's defined, we can't be certain there's actually an issue. The duplication aspect is minor since it's just a simple guard clause. I might be too quick to dismiss the duplication concern - repeated guard clauses could indicate a need for a higher-level architectural change. Also, using an undefined constant could cause runtime errors. While those are fair concerns, we don't have enough context to know if AUTO_UPDATER_DISABLED is properly defined elsewhere. The duplication is minimal and serves a clear purpose in each function. Delete the comment. Without seeing the full codebase context around AUTO_UPDATER_DISABLED's definition, we can't be certain there's an actual issue here.

Workflow ID: wflow_bzpqueEN4lsGrS5A

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed dcb4617 in 1 minute and 40 seconds. Click for details.
  • Reviewed 71 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. web-app/src/hooks/__tests__/useAppUpdater.test.ts:257
  • Draft comment:
    Replacing direct state mutation with a call to checkForUpdate improves encapsulation. This ensures the hook’s internal logic is exercised rather than bypassed.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_BsRXwDKd7EikjXJ2

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@github-actions
Copy link
Contributor

Barecheck - Code coverage report

Total: 28.69%

Your code coverage diff: -0.11% ▾

Uncovered files and lines
FileLines
web-app/src/hooks/useAppUpdater.ts57-59, 157-159
web-app/src/routes/settings/general.tsx71, 75-76, 96, 98-99, 110-111, 125, 130, 134-135, 139-146, 149-153, 155-160, 163-170, 172-185, 187-188, 190-193, 196-202, 204-209, 218-221, 229-232, 236-237, 239-241, 264-274, 276-281, 283, 318, 323, 328-333, 362-372, 374-375, 410-414

Copy link
Contributor

@louis-jan louis-jan left a comment

Choose a reason for hiding this comment

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

LGTM

@Minh141120 Minh141120 merged commit b9d6aec into dev Aug 14, 2025
16 checks passed
@Minh141120 Minh141120 deleted the fix/feature-toggle-auto-updater branch August 14, 2025 08:27
@github-project-automation github-project-automation bot moved this to QA in Jan Aug 14, 2025
@github-actions github-actions bot added this to the v0.6.9 milestone Aug 14, 2025
louis-jan pushed a commit that referenced this pull request Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants