Skip to content

Commit

Permalink
fix: update notifier never running
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed May 4, 2024
1 parent 7fe9cc4 commit 330a1b2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion frappe/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
is_energy_point_enabled,
)
from frappe.utils import add_user_info, cstr, get_system_timezone
from frappe.utils.change_log import get_versions
from frappe.utils.change_log import get_versions, has_app_update_notifications
from frappe.website.doctype.web_page_view.web_page_view import is_tracking_enabled


Expand Down Expand Up @@ -108,6 +108,7 @@ def get_bootinfo():
bootinfo.subscription_conf = add_subscription_conf()
bootinfo.marketplace_apps = get_marketplace_apps()
bootinfo.changelog_feed = get_changelog_feed_items()
bootinfo.has_app_updates = has_app_update_notifications()

return bootinfo

Expand Down
2 changes: 1 addition & 1 deletion frappe/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@
],
"daily_long": [
"frappe.integrations.doctype.dropbox_settings.dropbox_settings.take_backups_daily",
"frappe.utils.change_log.check_for_update",
"frappe.integrations.doctype.s3_backup_settings.s3_backup_settings.take_backups_daily",
"frappe.email.doctype.auto_email_report.auto_email_report.send_daily",
"frappe.integrations.doctype.google_drive.google_drive.daily_backup",
Expand All @@ -257,6 +256,7 @@
"frappe.integrations.doctype.dropbox_settings.dropbox_settings.take_backups_weekly",
"frappe.integrations.doctype.s3_backup_settings.s3_backup_settings.take_backups_weekly",
"frappe.desk.form.document_follow.send_weekly_updates",
"frappe.utils.change_log.check_for_update",
"frappe.social.doctype.energy_point_log.energy_point_log.send_weekly_summary",
"frappe.integrations.doctype.google_drive.google_drive.weekly_backup",
"frappe.desk.doctype.changelog_feed.changelog_feed.fetch_changelog_feed",
Expand Down
11 changes: 6 additions & 5 deletions frappe/public/js/frappe/desk.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,12 @@ frappe.Application = class Application {
}

show_update_available() {
if (frappe.boot.sysdefaults.disable_system_update_notification) return;

frappe.call({
method: "frappe.utils.change_log.show_update_popup",
});
if (
!frappe.boot.has_app_updates ||
cint(frappe.boot.sysdefaults.disable_system_update_notification)
)
return;
frappe.xcall("frappe.utils.change_log.show_update_popup");
}

add_browser_class() {
Expand Down
4 changes: 4 additions & 0 deletions frappe/utils/change_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ def check_for_update():
add_message_to_redis(updates)


def has_app_update_notifications() -> bool:
return bool(frappe.cache.sismember("update-user-set", frappe.session.user))


def parse_latest_non_beta_release(response: list) -> list | None:
"""Parse the response JSON for all the releases and return the latest non prerelease.
Expand Down

0 comments on commit 330a1b2

Please sign in to comment.