Check for updates in the background while the window is open, and signal new results with a badge

オープン
#1,119 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
desktop

調査の方向性

Start with mintUpdate.py and trace _auto_refresh_tick(), refresh(), refresh_updates(), and show_updates_in_UI() to understand how background fetching is separated from rebuilding the visible list. Review the existing notification path and the related issues (#923, #1054, #951, #933, #603, #727, #795) before estimating the change. Done means updates can be checked while the window is open, the current list and selections remain intact, and the indicator and notification clear after the refreshed list loads.

索引モデルが issue の本文から書いたものです。

説明

Is your feature request related to a problem? Please describe.
Auto-refresh only runs when the Update Manager window is closed (tray mode). While the window is open, _auto_refresh_tick() defers the refresh every 60 seconds:

if not self.hidden or self.refreshing:
    why = "window is open" if not self.hidden else "another refresh is in progress"
    self.logger.write(f"Auto refresh deferred ({why}); will retry shortly")
    self.auto_refresh_source.arm(60)

So if the window is left open (behind other windows, on another workspace, or while the screen is locked), the list of updates goes stale indefinitely, and the user gets no signal that anything new is available. #923 shows a log of exactly this happening for a week. The result is that refresh behavior is inconsistent: it depends on whether the window happens to be open.

I understand why the refresh is deferred: rebuilding the list while the user is looking at it, or after they have unchecked some packages, would be disruptive.

Describe the solution you'd like
Separate checking for updates from updating the visible list:

  1. Keep running the scheduled refresh while the window is open, but do not rebuild the visible list.
  2. If the result differs from what is displayed, show an indicator next to the Refresh button (for example a small dot or symbol) meaning "new updates available, click Refresh to load them."
  3. Also send a desktop notification, like the existing "Updates are available" notification. Cinnamon's grouped window list already shows a badge on an app's taskbar icon with the number of pending notifications for that app (getNotificationCountForApp() in appGroup.js). This is how Steam, Signal, and others get a red badge. Update Manager would get a taskbar badge for free, as long as the notification is associated with the app. A badge of "1" is fine, since it only needs to say "something is there."
  4. Clicking Refresh (or the notification) loads the new list. Clear the indicator and notification when that happens.

The list never changes under the user, so selections are safe, and the user still learns that updates are waiting.

Describe alternatives you've considered

  • Only defer the refresh while the window has focus (and its dialogs, such as Preferences and Software Sources, count as focus). Refresh normally when it is unfocused. This is simpler but can still discard package selections, unless selections are preserved across refreshes.
  • Always refresh while the screen is locked (org.cinnamon.ScreenSaver.GetActive or logind LockedHint). This has the same selection caveat.
  • A "stale" indicator based only on time since the last refresh, as suggested in #1054. This is trivial but does not tell the user whether anything new exists. This proposal goes further by actually checking in the background.

Additional context: implementation notes
From reading mintUpdate.py, the refresh pipeline already separates fetching from displaying, so this looks like a moderate change:

  • refresh() starts the cache refreshes on background threads, then refresh_updates() builds a plain list (model_items) without touching the UI. Only the final show_updates_in_UI() call rebuilds the Gtk.TreeStore. A background refresh could stop before that call, keep model_items, compare it with the displayed list, and set the indicator.
  • refresh() immediately calls set_refresh_mode(True) (spinner page, disabled toolbar, menu, and Install button), clear_infobars(), and set_status(). A background mode would skip these.
  • refresh_apt_cache() passes interactive=not self.hidden. A background refresh should be non-interactive.
  • Installs are currently kept from overlapping a refresh only because set_refresh_mode() disables the Install button. A background refresh would need an explicit guard: do not start one during an install, and make Install wait for (or cancel) a running background refresh.
  • After a background refresh, the displayed versions may be older than what APT would install. The indicator covers this, since it tells the user the list is out of date.

Related: #923, #1054, #951, #933, #603, #727, #795.

主要言語
Python
スター
428
フォーク
196
平均マージ
16時間 9分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

linuxmint/mintupdate のほかの issue

linuxmint/mintupdate の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。