jekyll / jekyll-admin

A Jekyll plugin that provides users with a traditional CMS-style graphical interface to author content and administer Jekyll sites.
https://jekyll.github.io/jekyll-admin/
MIT License
2.82k stars 357 forks source link

Fix duplicated entries bug #698

Closed rpeyron closed 1 year ago

rpeyron commented 1 year ago

I was getting duplicated entries on my jekyll-admin instance for each content type (drafts, static files,...). I was not able to debug the ruby code to understand what was going on and it does not occur with the test site of jekyll-admin. But by replacing .entries method of Pathname with .children (that do not include dot directories) I have no more the duplicated entries issue.

ashmaroli commented 1 year ago

By calling next, we skip the current iteration. Therefore, the proposed change does not make sense. In other words, this doesn't really fix anything. You may still encounter duplicate entries at random. Keep making random edits to your source files to trigger this flaky elusive bug.

rpeyron commented 1 year ago

You are perfectly right that was not making sense, and indeed the duplicates came back. I was not conscious it was kinda random, I will keep investigating and try to learn how to debug ruby code (the only thing I am sure about is that the duplication occurs on the server part). Sorry