Skip to content

Conversation

@WSXYT
Copy link
Collaborator

@WSXYT WSXYT commented Jan 11, 2026

This pull request focuses on improving the application's restart mechanism and the update checking experience, along with several bug fixes and minor enhancements. The main changes include a robust solution for the restart feature to prevent deadlocks and unwanted command line windows, more accurate update check time handling, and improved user feedback during update checks. Additionally, several bug fixes and language improvements are included.

Application Restart Mechanism Improvements:

  • Refactored the restart logic to use an exit code (EXIT_CODE_RESTART) for signaling a restart, moving the actual process relaunch logic to main.py. This approach ensures only a single instance is running and prevents command line windows from appearing on restart, especially on Windows. [1]], [2]], [3]], [4]], [5]], [6]])
  • Added cross-platform process spawning logic in main.py that handles relaunching the application cleanly after receiving the restart exit code, with special handling to avoid console windows on Windows. [1]], [2]])

Update Checking and UI Enhancements:

  • Improved update check workflow: now uses a Qt signal (update_check_finished) to ensure UI updates and last check time are handled in the main thread, and accurately reflects the last successful check. [1]], [2]], [3]], [4]], [5]], [6]], [7]])
  • Enhanced last update check time display: shows "Never checked" if the update check has never been performed, with new language entries for both Chinese and English. [1]], [2]], [3]])

Bug Fixes and Minor Improvements:

  • Fixed issues with the update check time not updating after a successful check, and display errors when never checked. ([CHANGELOG/v2.2.0/CHANGELOG.mdL50-R56])
  • Fixed the settings linkage page issue where reopening the page would result in a blank display. ([app/view/settings/settings.pyR646-R649])
  • Corrected Sentry initialization logic to only enable it in non-development builds and enabled log capturing. [1]], [2]])

Changelog Updates:

  • Updated the changelog to reflect the above bug fixes and improvements, including more detailed descriptions of the restart and update check fixes. ([CHANGELOG/v2.2.0/CHANGELOG.mdL50-R56])

修复内容包括:重启异常,联动页面异常,更新时间异常
也许还有,但是我忘了,看上面ai生成的吧

WSXYT added 4 commits January 11, 2026 19:49
… and enable logs

人话:我脑子傻了写错判断了()
… and enable logs

人话:我脑子傻了写错判断了()
…andling

- Enhanced restart logic to handle single-instance issues and suppress console window pop-ups.
- Improved update check flow, added detailed status signals, and updated last check time display handling.
- Fixed linkage settings page reloading issue and ensured accurate status on update checks.
Copilot AI review requested due to automatic review settings January 11, 2026 13:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the application restart mechanism and update checking functionality, along with several bug fixes. The main changes refactor restart logic to use an exit code signal, improve update check time handling with thread-safe signals, and fix issues with linkage settings page display.

Changes:

  • Refactored restart mechanism to use exit code (EXIT_CODE_RESTART) with process relaunch logic in main.py to prevent deadlocks and console windows
  • Improved update check workflow using Qt signals for thread-safe UI updates and accurate last check time tracking
  • Fixed linkage settings page blank display issue and enhanced "never checked" display for update checks

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
main.py Added subprocess import, EXIT_CODE_RESTART handling, cross-platform restart logic, and corrected Sentry initialization
app/view/main/window.py Simplified restart_app to use EXIT_CODE_RESTART exit code instead of spawning process directly
app/view/settings/update.py Added update_check_finished signal for thread-safe UI updates and improved last check time handling
app/view/settings/settings.py Added courseSettingsInterface factory mapping to fix blank page issue
app/tools/variable.py Defined EXIT_CODE_RESTART constant (1000)
app/Language/modules/update.py Added "never_checked" translation entries for Chinese and English
CHANGELOG/v2.2.0/CHANGELOG.md Documented bug fixes for restart, update check time, and linkage settings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +210 to +211
# 过滤掉 --url 等参数
filtered_args = [arg for arg in sys.argv if not arg.startswith("--")]
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The restart logic filters out command-line arguments starting with "--" on line 211, but then unconditionally includes filtered_args[1:] implicitly. The first element of sys.argv (sys.argv[0]) is the script/executable name, and should be excluded from filtered_args. Currently, if sys.argv[0] doesn't start with "--", it will be included in filtered_args and passed as an argument to the new process. The filter should exclude sys.argv[0] by using filtered_args = [arg for arg in sys.argv[1:] if not arg.startswith("--")].

Suggested change
# 过滤掉 --url 等参数
filtered_args = [arg for arg in sys.argv if not arg.startswith("--")]
# 过滤掉 --url 等参数,并且跳过 sys.argv[0](可执行文件路径)
filtered_args = [arg for arg in sys.argv[1:] if not arg.startswith("--")]

Copilot uses AI. Check for mistakes.

# 仅在开发环境(版本号包含 0.0.0)下初始化 Sentry
if VERSION == "v0.0.0":
# 仅在开发环境(版本号不包含 0.0.0)下初始化 Sentry
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The comment is incorrect - it states "仅在开发环境(版本号不包含 0.0.0)下初始化 Sentry" (Only initialize Sentry in development environment where version doesn't contain 0.0.0), but the condition if "0.0.0" not in VERSION: actually initializes Sentry in non-development builds (when version doesn't contain "0.0.0"). The comment should say "仅在非开发环境" (Only in non-development environment) or the logic should be inverted to match the comment.

Suggested change
# 仅在开发环境(版本号不包含 0.0.0)下初始化 Sentry
# 仅在非开发环境(版本号不包含 0.0.0)下初始化 Sentry

Copilot uses AI. Check for mistakes.
@lzy98276 lzy98276 merged commit 6e96d58 into SECTL:master Jan 11, 2026
10 of 13 checks passed
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.

2 participants