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

Sync no longer working #32

Open
swehba opened this issue Dec 26, 2021 · 5 comments
Open

Sync no longer working #32

swehba opened this issue Dec 26, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@swehba
Copy link

swehba commented Dec 26, 2021

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

Describe the bug

Syncing is no longer working.

Steps to reproduce

  1. Select "Things Logbook: Sync" from the command palette.

Expected behavior

  1. I expect to see a notification that sync completed, but no message appears.
  2. I expect that newly completed tasks in Things appear in my daily note, but nothing is added.

Screenshots

Here's a snapshot from the developer's console:

[Things Logbook] fetching tasks from sqlite db...
VM411:674 [Things Logbook] fetched 98 tasks from sqlite db
VM411:689 [Things Logbook] fetching checklist items from sqlite db...
VM411:694 [Things Logbook] fetched 0 checklist items from sqlite db
app.js:1 Uncaught (in promise) RangeError: Invalid line number 34 in 33-line document
    at t.e.line (app.js:1)
    at zu (app.js:1)
    at t.replaceRange (app.js:1)
    at updateSection (eval at <anonymous> (app.js:1), <anonymous>:383:20)
    at async ThingsLogbookPlugin.syncLogbook (eval at <anonymous> (app.js:1), <anonymous>:790:13)

Environment (please specify)

OS

macOS 11.6.1

Obsidian Version (e.g. v0.10.6)

0.13.6

Theme (if applicable):

If the bug is visual, please provide the name of the Community Theme you're using.

@swehba swehba added the bug Something isn't working label Dec 26, 2021
@liamcain
Copy link
Owner

Interesting, sounds like this broke from the Obsidian update. I'll take a look this weekend.

@mikekocik
Copy link

Have the same issue but it doesn't happen every time.
If I rename today's daily note and let the sync create a new one, sync starts to work again for some time.
But I couldn't figure out what causes the crash yet

@Automatt
Copy link

I think this has something to do with trying to update the current note that it is open in the editor. For some reason the length of the document is returned incorrectly and causes the above error, which stops sync.

@kurtharriger
Copy link
Contributor

I recently noticed this as well and believe it is caused in part by the new editor experience.

2022-01-14_10-15-01

I can confirm the source file does have 9 lines in it.
I was able to track it down to the following bit of source code and added some logging and it appears logbook sync does say to replace to line 9.
https://github.com/liamcain/obsidian-things-logbook/blob/main/src/textUtils.ts#L75

I think the bug may be in the new editor itself and found that disabling the new editor does in fact resolve the issue.

@kurtharriger
Copy link
Contributor

Reached out on discord and, in theory, there will be a fix for it in the next insider build.
https://discord.com/channels/686053708261228577/840286264964022302/931627709149380669

Until then I would recommend temporarily disabling the new editor to run the sync command and then turning it back on after it syncs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants