Blot
Blot copied to clipboard
Sync hangs while parsing poorly formatted YAML
Hi @davidmerfield. I'm really enjoying using Blot, thank you for all the hard work on it!
I have some files with a poorly formatted YAML front matter that seem to cause the syncing to hang on the backend. When one of these files was included in my git commit, the "syncing" message stays stuck on the first file it scans that has the bad YAML:

This appears to block the whole commit from being synced. It then takes a few minutes before the backend starts noticing new commits again, I'm assuming there's some timeout that stops the hung syncing process.
Below are contents of an example .md file that successfully reproduces the issue for me.
---
tags:
status: publish
- test
---
# test-post
state 4
This is a small issue that isn't a blocker for me as I've fixed my YAML formatting, but when it occurs it stops syncing for a few minutes and it's difficult to discover the reason. It may be good to fix this to avoid any confusion for others. Let me know if I can provide any other information!
Sorry about this, this is bad. I need to fix this and tell Jonathan too
Thanks @davidmerfield. Tried some more pushes yesterday and experienced some other strange metadata caused syncing issues that were not isolated to YAML front matter, they occurred when I used the standard key: value syntax as well.
I saw you fixed the issue where one file hanging would stop all the files from syncing, so I was able to update other files without the problematic metadata. But the problematic file would not update until I removed it and re-added it with a different name (or it would take longer to stop hanging than I was willing to wait to find out).
I'm not 100% sure, but I think the following metadata format was causing the issue:
list: val1, val2, val3 with spaces, val4
I thought I also saw an issue with parsing dates like date: 2022-03-03 and changing to date: 2022/03/03 worked ok, but it's possible that was actually just related to other issues (sync hanging or other metadata). I haven't run enough trials to isolate exactly what's happening here.
Might as well mention another parsing issue I've discovered: images in lists don't get parsed and cause the sync to hang.
- Here's a photo I like.
- 
Wrapping it in a div solves it when it's an outermost list, at least:
- Here's a photo I like.
- <div></div>
These latest issues I'm discovering because I use Logseq for my notes and I'm trying to publish from there with as little changes as possible (all the markdown content is in lists). The above mentioned metadata issues and this are the biggest hurdles I've seen so far (besides doing some css work to make the lists look ok).
If I find time at some point I will try to look through the parsing logic and contribute, but I haven't had a chance yet and don't know the best way to set up a testing environment.
This should now be fixed by 86b02c9
@daydemir The bug with images in lists seems to be resolved too?
Thank you for the report – please let me know if you have any questions