Skip to content

Cache autoupdate check to run only once per 24 hours#2276

Merged
m-mohamedin merged 2 commits intojgraph:devfrom
murataslan1:fix/cache-autoupdate-check
May 5, 2026
Merged

Cache autoupdate check to run only once per 24 hours#2276
m-mohamedin merged 2 commits intojgraph:devfrom
murataslan1:fix/cache-autoupdate-check

Conversation

@murataslan1
Copy link
Copy Markdown
Contributor

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
Comment thread src/main/electron.js Outdated

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
Copy link
Copy Markdown

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?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

to me a command line option for suppressing update checks all together, might be helpful for real scripting. some automated build environments aren't permitted for the internet and thus a network access timeout might not be desirable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@alexanderLinear Running the command with '--disable-update' or setting environment variable DRAWIO_DISABLE_UPDATE=true would stop checking for updates

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
codeCraft-Ritik

This comment was marked as spam.

@murataslan1
Copy link
Copy Markdown
Contributor Author

Hi there! Just a friendly follow-up on this PR. Is there anything I can do to help move this forward? Happy to address any feedback or make adjustments if needed. Thanks for your time!

@m-mohamedin m-mohamedin merged commit 9bfa3bb into jgraph:dev May 5, 2026
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

5 participants