liamcain / obsidian-things-logbook

Sync your Things 3 Logbook with Obsidian
MIT License
120 stars 22 forks source link

No Sync on DB #27

Open 42sol-eu opened 2 years ago

42sol-eu commented 2 years ago

Before Submitting: Double-check that you are running the latest version of the plugin. The bug might have already been fixed 😄

Describe the bug

A fetch of 0 tasks updates the sync time (this is fine if there are no tasks). A failed access (maybe on iOS) returns 0 tasks fetched.

After one failed call (this might be a call on winOS or iOS) the sync time (this.options.latestSyncTime) will be set to the active timestamp and new syncs will not fetch any old tasks.

This comes from here:

async syncLogbook() {
        const logbookRenderer = new LogbookRenderer(this.app, this.options);
        const dailyNotes = getAllDailyNotes_1();
        const latestSyncTime = this.options.latestSyncTime || 0;

Steps to reproduce

I fixed my problem by a hard reset of the latestSyncTime, replacing the initialisation of latestSyncTime

const latestSyncTime = 0;

And reinserting the correct code afterwards.

Expected behavior

Environment (please specify)

OS

macOS

Obsidian Version (e.g. v0.10.6)

- Things3
    - Version: 3.15.7 (31507503)
- Obsidan 
    - Version: 0.12.19