nvim-orgmode / orgmode

Orgmode clone written in Lua for Neovim 0.9+.
https://nvim-orgmode.github.io/
MIT License
3.04k stars 134 forks source link

Duplicate files are created #566

Closed kflak closed 1 year ago

kflak commented 1 year ago

Describe the bug

Hi,

At first I wasn't quite sure, but now it seems that this happens occasionally: I work on a file in ~/org/foo/bar.org. Close it, do other stuff. After a few days I return to find that now I also have ~/org/bar.org in addition to ~/org/foo/bar.org. Any idea how I can pinpoint what exactly is going on here?

❯ nvim -v           
NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Package manager: lazy.nvim

org config:

require'orgmode'.setup_ts_grammar()
require'orgmode'.setup({
    org_agenda_files = {'~/org/**'},
    org_default_notes_file = '~/org/notes.org',
    org_todo_keywords = {'TODO(t)', 'WAITING(w)', '|', 'DONE(d)'},
    notifications = {
        enabled = true,
        cron_enabled = false
    }
})
vim.opt.conceallevel = 2
vim.opt.concealcursor = 'nc'
vim.opt.formatoptions  = 'jcql'

Steps to reproduce

Open file, edit, save, close...

Expected behavior

No duplicates should be created.

Emacs functionality

No response

Minimal init.lua

Will try to work with a minimal init file if this persists or nobody has any ideas what's happening, but for the time being this is too diffuse, and I would have to work with a minimal init all the time, which I can't really afford atm. Sorry...

Screenshots and recordings

No response

OS / Distro

Arch linux 6.3.4-arch2-1

Neovim version/commit

0.9.1

Additional context

It seems quite random how it happens. Just finished editing a file now, but no duplicate was made. However, I had to clean out a whole bunch of dupes from other files that have accumulated. Weeeeird....

kristijanhusak commented 1 year ago

We don't actually have any specific features that creates the files. We have certain actions that can update other files, and that is maybe where the issue happens. What actions do you do the most? Do you do a lot of refiling, archiving, or something similar?

kflak commented 1 year ago

Yeah, that's the bizarre thing: I'm not doing any of that stuff. Will keep an eye out for this now that I know it's happening and try to narrow down the situations where this could happen.

EDIT: I might have a suspicion... using Orgzly on my phone, keeping it in sync with syncthing. Seems like a likely culprit. Keeping the issue open for now, will close when I can confirm that this is the case.

EDIT 2: Bingo! Orgzly/syncthing messes things up.