Files don't update when markdown content changes.
Hi there,
When using Pull Posts > Pull only changes or the GitHub webhook, I sometimes don't see content update. Meaning, Git It Write considers the files to be the same as last push.
This has happened in the following examples:
Fixing a markdown link, for example when I replace a malformed link like [some link]http://google.com) by adding the missing parentheses [some link](http://google.com)
It also seems to occur if I just add a completely new code block to the top of the file.
I can confirm via the logs that Git It Write doesn't see the content as having changed.
Not sure how the comparison is being done, but it appears to be "text nodes only" or something — to resolve the issue, i just commit a piece of dummy text and then revert it. Ideally it would be timestamps on the files or md5 hashes of the markdown content...
Hi @sudara,
GIW identifies changes by looking at the hash github provides. Every file has a hash and this hash is stored in the post's meta. If this hash changes, the post is updated.
My guess is that,
- File is not commited and pushed to Github
- Wrong repo/file being tracked.
- File is commited to different branch and posts are pulled from different branch.
Thanks
Hi @vaakash,
Thanks for the reply. Great to hear that it breaks "cache" based on the git hash, that's perfect.
I'm not exactly sure what's going on then, as I definitely had the issue multiple times. It was always with non-text markdown elements being adjusted, like in my "bad link" example.
RE: your questions
- It's committed and pushed
- Same repo as always, occurred with multiple files until I modified text to "break" the cache.
- There's only one branch
I'll let you know if find something reproducible...
Hmm, I just did a test where I deleted the bottom half of the article. The log looks like this:
12/09/2024 17:47 - ++++++++++ Done ++++++++++
12/09/2024 17:47 - ++++++++++ Publishing posts ++++++++++
12/09/2024 17:47 - Allowed file types - md
12/09/2024 17:47 - At repository item - test-new
12/09/2024 17:47 - ---------- Checking post [3099] under parent [0] ----------
12/09/2024 17:47 - {.aligncenter}
...
12/09/2024 17:52 - ++++++++++ Done ++++++++++
12/09/2024 17:52 - {"result":1,"message":"Successfully published posts","stats":{"posts":{"new":[],"updated":{"1778":"https:\/\/juce.com\/tutorials\/test\/"},"failed":0},"images":{"uploaded":[],"failed":0}}}
12/09/2024 17:52 - ********** END **********
But the content of the post didn't change. When I go to edit, the full article is still there.
So it looks like the change detection is working fine, but something about the parsing is maybe off. The content line quoted in the log is also a bit random, there's still content after that.
I'll take a look locally maybe to see what's happening, since I'm actually still having problems with #48. I thought my PR resolved it, but there's still some cases where the code isn't highlighting...
Thats weird, may be the post is not getting saved as expected or there is some error when converting the markdown to the HTML. If you have any custom modifications to the markdown converter, then that is something to look at for issues.
I would suggest, disable/remove all custom markdown changes and try if the file is pulled and updated correctly. This will help narrow down the issue.
If this happens with vanilla GIW plugin, please let me know how I can repro the issue on my end. I tried the same on my local setup, but couldn't repro the issue.