Skip to content

Conversation

@murataslan1
Copy link

Summary

This PR caches the autoupdate check so it only runs once per 24 hours instead of on every application start.

Problem

When running drawio frequently or in scripts (even with --help flag), the autoupdate check runs every time, outputting messages like:

Checking for beta autoupdate feature for deb/rpm distributions
Found package-type: deb

This is especially annoying when running drawio in a loop or automated scripts.

Solution

  • Store the last update check timestamp in electron-store
  • Only perform update check if 24 hours have passed since the last check
  • Existing behavior is preserved: users can still manually check for updates via the menu

Changes

  • Modified src/main/electron.js to cache update check timestamp

Fixes #2262

Previously, the update check ran on every application start, which was
annoying when running drawio in scripts or frequently from CLI (even
with --help flag).

This change caches the last update check timestamp and only performs
a new check if 24 hours have passed since the last one.

Fixes jgraph#2262

if (store == null || (!disableUpdate && !store.get('dontCheckUpdates')))
// Cache update check - only check once per 24 hours to avoid repeated messages
const UPDATE_CHECK_INTERVAL = 24 * 60 * 60 * 1000; // 24 hours

Choose a reason for hiding this comment

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

Please make this UPDATE_CHECK_INTERVAL configurable. Hardcoding 24h looks like a kludge. What if I want to check once per week?

Allow users to configure the update check interval via 'updateCheckIntervalHours'
setting in electron-store. Default remains 24 hours for backward compatibility.

Example: Set to 168 for weekly checks.
@murataslan1 murataslan1 force-pushed the fix/cache-autoupdate-check branch from 2badbe8 to a7eb97c Compare December 3, 2025 09:04
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.

Cache autoupdate check

2 participants