Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make plugin watchdog considering timestamp of last run. Fixes #59370 #59371

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

borysiasty
Copy link
Member

Description

When you quickly run two QGIS instances one by one, it often wakes the plugin watchdog up: one instance sets the QgsSettings entry, and then the another sees it and thinks it's a crash leftover.

This PR contains a proposed solution: switching the settings entry from boolean value to timestamp. Entries older then 5 seconds are considered crash leftovers, while newer are considered to come from a parallel instance.

Backward compatibility is ensured:

  1. Older QGIS versions only check if the entry exists, so the new datatype doesn't hurt them.
  2. Settings written by older QGIS versions (true) are converted to integer 1, thus are recognized as a very old timestamp.

Copy link

github-actions bot commented Nov 7, 2024

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 146371d)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 146371d)

@borysiasty borysiasty added the Squash! Remember to squash this PR, instead of merging or rebasing label Nov 7, 2024
@@ -118,7 +118,8 @@ def __init__(self):
self.uninstallPlugin(key, quiet=True)
updateAvailablePlugins()
if plugin_is_active:
settings.setValue("/PythonPlugins/watchDog/" + key, True)
settings.setValue("/PythonPlugins/watchDog/" + key,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should switch to a new key here -- I'm worried changing the value type for an existing key may cause issues if a profile is shared with older qgis versions...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-3_40 Bug Either a bug report, or a bug fix. Let's hope for the latter! Plugins Squash! Remember to squash this PR, instead of merging or rebasing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants