Closed rpeyron closed 1 year ago
Hello @rpeyron
Is the --no-watch
option needed to reproduce this?
Regardless, are you willing to submit a Pull Request?
Hello @ashmaroli, no, on the contrary you have to not use --no-watch
to reproduce the issue, as it is a workaround to solve the issue.
I am willing to help on this subject, but I don't know enough of jekyll and jekyll-admin to be sure where this problem has to be solved (maybe more related to jekyll thant jekyll-admin?). The most obvious PR I can submit is to remove the site.process in file_helper.rb that are redundant with the watch feature of jekyll serve ; as a side effect it won't update the site if jekyll-admin is used outside jekyll serve command or with --no-watch
option, I don't know if this is a use case you judge important for jekyll-admin.
on the contrary you have to not use
--no-watch
to reproduce the issue, as it is a workaround...
Ah! My apologies. I overlooked the section title. I did seem weird that --no-watch
would trigger this. Hence asked you.
Anyways, pull request is welcome. The root cause is a race condition occurring between Jekyll's watching and the admin backend regeneration. We have employed temporary hacks in the past to address this issue but none held out satisfactorily through time.
Description:
Files are displayed duplicated after saving with jekyll-admin.
Example:![image](https://user-images.githubusercontent.com/3126751/208242294-4aae3915-c380-4684-824a-cbf28ff705d6.png)
Tell us a bit about yourself:
bundle show
to check>: 0.11.1bundle show
to check>: 4.3.1node -v
to check>: v16.18.1Steps to reproduce:
Note: I have not been able to reproduce with the spec/fixtures test site ; maybe it is too fast to generate to have concurrency issues
I expected the following:
Files are not shown duplicated
But got the following, instead:
Files are shown duplicated
The console also reports other errors as:
conflicting chdir during another chdir block
or content duplication warning with same source fileand site.collections contain all entries duplicated
Other details:
Workarounds that I found:
bundle exec jekyll serve --live-reload --no-watch
site.process
commands in file_helper.rbI guess the two lines above are triggering the same process that may cause problems when run concurrently