Vinzent03 / obsidian-git

Integrate Git version control with automatic backup and other advanced features in Obsidian.md
MIT License
6.93k stars 296 forks source link

[Bug]: Repeated notification that "Everything is up to date" and high CPU usage, even when plugin disabled #816

Closed izosozi closed 1 day ago

izosozi commented 2 days ago

Describe the bug

Setting sync timing to 0 caused indefinite, repeated "Everything is up to date" notifications (indicating an infinite loop of git pull commands?), using lots of CPU, even though the plugin shouldn't be doing anything at all.

I unfortunately can't trace back the exact steps that led to this, but here's the basic context. I'll add to this in case I get it to happen again.

Relevant errors (if available) from notifications or console (CTRL+SHIFT+I)

{
    "settings": {
        "commitMessage": "obsidian-git manual vault backup: {{date}}",
        "commitDateFormat": "YYYY-MM-DD HH:mm:ss",
        "autoSaveInterval": 0,
        "autoPushInterval": 0,
        "autoPullInterval": 0,
        "autoPullOnBoot": true,
        "disablePush": false,
        "pullBeforePush": true,
        "disablePopups": false,
        "disablePopupsForNoChanges": false,
        "listChangedFilesInMessageBody": false,
        "showStatusBar": true,
        "updateSubmodules": false,
        "syncMethod": "merge",
        "customMessageOnAutoBackup": false,
        "autoBackupAfterFileChange": true,
        "treeStructure": false,
        "refreshSourceControl": true,
        "basePath": "",
        "differentIntervalCommitAndPush": false,
        "changedFilesInStatusBar": false,
        "showedMobileNotice": true,
        "refreshSourceControlTimer": 5000,
        "showBranchStatusBar": true,
        "setLastSaveToLastCommit": false,
        "submoduleRecurseCheckout": false,
        "gitDir": "",
        "showFileMenu": true,
        "authorInHistoryView": "hide",
        "dateInHistoryView": false,
        "lineAuthor": {
            "show": false,
            "followMovement": "inactive",
            "authorDisplay": "full",
            "showCommitHash": false,
            "dateTimeFormatOptions": "date",
            "dateTimeFormatCustomString": "YYYY-MM-DD HH:mm",
            "dateTimeTimezone": "viewer-local",
            "coloringMaxAge": "1y",
            "colorNew": {
                "r": 255,
                "g": 150,
                "b": 150
            },
            "colorOld": {
                "r": 120,
                "g": 160,
                "b": 255
            },
            "textColorCss": "var(--text-muted)",
            "ignoreWhitespace": false,
            "gutterSpacingFallbackLength": 18,
            "lastShownAuthorDisplay": "full",
            "lastShownDateTimeFormatOptions": "date"
        },
        "autoCommitMessage": "obsidian-git automatic vault backup: {{date}}"
    },
    "pluginVersion": "2.28.2"
}

Steps to reproduce

These steps alone will likely not reproduce the bug, but it was at least the direct trigger.

  1. obsidian-git was configured and running properly, automatically committing and syncing with a remote as expected
  2. I changed the commit-and-sync time to 0 and the auto-push time to 0, auto-pull was greyed out.

Expected Behavior

Expected: This would disable any git commands and the plugin should remain idle.

Actual: Git commits and pushes seemed to stop, but "Everything is up to date" notifications begin spawning around 2x per second indefinitely. My CPU usage spiked and caused high temps.

I clicked "Disable on this device" in the obsidian-git settings, but this didn't stop the notifications until I quit Obsidian (this part I expected, since it does tell you to restart Obsidian at that point).

Additional context

The reason I set the auto time settings to 0 was to stop any git interactions with the remote repo without having to restart Obsidian. This was in order to wipe the remote and local repo clean during the process of troubleshooting a similar issue in the iOS app, in which repeated "buffer error" notifs appear at a high rate; this might be related or an indirect cause.

System:

Software:

.gitignore:

.obsidian/plugins/

Obsidian Vault contents

.
├── .git
├── .gitignore
├── .obsidian
│   ├── app.json
│   ├── appearance.json
│   ├── community-plugins.json
│   ├── core-plugins.json
│   ├── graph.json
│   ├── plugins
│   │   ├── github-embeds
│   │   ├── obsidian-excalidraw-plugin
│   │   ├── obsidian-git
│   │   ├── obsidian-minimal-settings
│   │   ├── obsidian-style-settings
│   │   └── system3-relay
│   ├── themes
│   │   ├── Encore
│   │   ├── GitHub Theme
│   │   ├── Minimal
│   │   ├── Terminal
│   │   └── Transparent
│   ├── types.json
│   └── workspace.json
└── Untitled.md

Operating system

macOS

Installation Method

None

Plugin version

2.28.2

EDIT 2024-11-23:

The problem hasn't happened again after these steps:

My guess is the pull attempts were affecting the settings for the plugin since they weren't properly excluded in my first .gitignore, which prevented the new value of the auto pull setting from being saved. I know nothing about the codebase so, take that with a grain of salt.

Vinzent03 commented 1 day ago

Thanks for the detailed issue report. Should be fixed now in 2.29.0.