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

links breaking after adding a new note via ZkNew #236

Closed
nathanbraun opened this issue Jul 6, 2022 · 6 comments · Fixed by #237
Closed

links breaking after adding a new note via ZkNew #236

nathanbraun opened this issue Jul 6, 2022 · 6 comments · Fixed by #237
Labels
bug Something isn't working

Comments

@nathanbraun
Copy link

nathanbraun commented Jul 6, 2022

Not sure if this is an zk-nvim or zk issue, but...

On initial db creation (if I delete notebook.db, then do zk index) all the links work fine. I can look at it in my db GUI and everything looks good.

However, if I add a new note using :ZkNew, all the values of target_id in the links table of notebook.db get updated to whatever the new note's ID is.

Everything goes back to working if I delete notebook.db then regenerate it, but that's obviously tedious to do. Note adding a link seems to work fine, it's just creating a new note that is causing issues.

@mickael-menu
Copy link
Member

Hum that's really weird. Would you mind giving detailed steps to reproduce this issue? Which ZkNew you run and maybe a sample zk notebook, as well as which versions of zk and zk-nvim you're using. Thanks.

@nathanbraun
Copy link
Author

nathanbraun commented Jul 6, 2022

I made a repo illustrating it:

https://github.com/nathanbraun/zk-test

I started out with 3 notes (main branch of referenced repo). Screenshot of links:

links_before

Then I added a note (calling <Cmd>ZkNew<CR>, which I've mapped to <leader>zn). That note gets the id 4 and turns the links to this:

Screen Shot 2022-07-06 at 2 38 04 PM

I added that note in the add-note branch so you can see that too.

My zk version is: zk HEAD-68e6b70. I just installed zk-nvim a few days ago, and believe that's the latest version too. Note I am using it with vimwiki + a custom template, different file extension etc.

@mickael-menu mickael-menu added the bug Something isn't working label Jul 9, 2022
@mickael-menu
Copy link
Member

mickael-menu commented Jul 9, 2022

Thank you, I can reproduce the problem. The issue happens with zk new too, I'm moving the issue to the other repo.

@mickael-menu mickael-menu transferred this issue from zk-org/zk-nvim Jul 9, 2022
@mickael-menu
Copy link
Member

@nathanbraun #237 (branch issue-62) should fix this issue, but I would appreciate if you could double check before I merge it. Thanks!

@nathanbraun
Copy link
Author

@nathanbraun #237 (branch issue-62) should fix this issue, but I would appreciate if you could double check before I merge it. Thanks!

Just tried it and it's working for me! Thank you!

@nathanbraun
Copy link
Author

Closed, but on second thought will let you close it when it's merged. Looked good though

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

Successfully merging a pull request may close this issue.

2 participants