Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zettlr fails to scan YAML frontmatter when opening a workspace #3887

Closed
2 of 5 tasks
cdelavegamartin opened this issue Nov 10, 2022 · 10 comments
Closed
2 of 5 tasks

Zettlr fails to scan YAML frontmatter when opening a workspace #3887

cdelavegamartin opened this issue Nov 10, 2022 · 10 comments
Labels
bug A bug that affects the functionality of Zettlr.

Comments

@cdelavegamartin
Copy link

Description

When opening a new workspace containing existing notes, formatted for zettlr, Zettlr doesn't seem to read the YAML frontmatter (does not display the title on the sidebar, or recognize tags in the frontmater for example). If I open a note, modify it, and save it then this gets updated. Restarting Zettlr or the computer doesn't fix this. Manually going through all the notes and modifying them is not feasible.

frontmatter
file list
tags

Reproducing

Copy existing notes to a new location, open a workspace in that new location

Zettlr Version

Stable (most recent version)

Specify version

2.3.0

Installation Method

From the Website or GitHub

Your Platform

  • Windows
  • macOS
  • Linux

Architecture

  • Intel 64bit
  • ARM 64bit

Operating System Version

Windows 10

Additional Information

I have tested versions 2.2.5 and 2.3.0 in Ubuntu 20.04, and this issue is not present

@cdelavegamartin cdelavegamartin added the bug A bug that affects the functionality of Zettlr. label Nov 10, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 10, 2022

Thanks so much for opening up your first issue here on the repository! 🎉 We would like to warmly welcome you to the community behind the app! ☺️ We'll check in soon and have a look at your issue. In the meantime, you can check your issue and make sure it aligns with our contribution guidelines! Here's the comprehensive list:

Enhancements

An enhancement takes a feature and improves or alters its behaviour. Please make sure to argue how your proposition will aid non-technical text workers, and why it can't be emulated easily with other features or apps!

Feature requests

Feature requests introduce whole new features into the app. This requires a lot of work, so these might be turned down if the implementation costs supersede the benefits we expect to see from implementing it. Please do not be disappointed if that happens. It likely has nothing to do with your great request but simply with us and our missing resources!
You can of course always ask someone to implement this feature, because a PR with a working new feature has much higher chances of being merged! :)

Bug reports

Please note that one of the main reasons for why bug reports cannot be addressed is that there's not enough information for us to find and fix the bug you describe, so make sure you try to pinpoint the bug as close as possible.
The ideal bug report for us has two qualities:

  1. The bug is always reproducible, at least within a certain context. 2. We know exactly what specifically goes wrong, and there is consensus on
    what should happen instead.

Please note that if you encounter behaviour that does not align with your expectations of what would happen, this might as well be simply intended behaviour and we need to simply clarify why the behaviour is the way it is. This is not to be considered a bug and such issues may be closed! Suggest an enhancement instead!
But now, have a great day and thank you again!

@nathanlesage
Copy link
Member

Could you please run the following steps and see if they fix the problem?

  1. Close the workspace with the corresponding notes.
  2. Restart Zettlr.
  3. Ensure the workspace is not open.
  4. Restart Zettlr again.
  5. Open the workspace again.

Then, in order to understand what happened, can you please describe the exact steps you have performed? To me, it sounds like the following, so please correct if I misunderstood:

  1. You had some notes existing in a directory that was loaded in Zettlr.
  2. You moved these outside the "visibility field" of Zettlr while running.
  3. You then proceeded to open the moved files as a new workspace.

@cdelavegamartin
Copy link
Author

Hi,

Thanks a lot for having a look at this. I have tried those steps and the result is the same.
I have done some more simplified testing and I could actually reproduce with a minimal example, with the note created externally, in notepad. I just created the folder structure:

├── test
│   ├── testfolder
│       ├── 20220520202020.md

And load the to top folder as the workspace, doesn't show the info in the frontmatter (title, tags)
tree and note
tags before modification
text in the frontmatter is parsed in the search though
search
If I do any modification (eg add a new line) and save, then it picks up the information in the frontmatter
tree and note after modification
tags after modification

@cdelavegamartin
Copy link
Author

Damn, I just did a clean reinstall, thinking it maybe was my configuration, and now it is is working, even after copying my configuration again. So closing because is no longer reproducible, must have been a fluke of my computer. Sorry for wasting your time.

@cdelavegamartin
Copy link
Author

cdelavegamartin commented Nov 14, 2022

After further testing, it is still happening. I've created a minimal example that demonstrates the behaviour for two notes in a workspace. Both were written externally (with Notepad on widows), and the configuration in Zettlr is a fresh install of the latest version for Windows x86_64. As before, If I modify the file that is not being scanned correctly (even just adding a space and deleting it, then save) then the frontmatter gets read without an issue.
Not recognized
Ok

To reproduce just unpack, and open the folder as a workspace.
test.zip

@cdelavegamartin
Copy link
Author

cdelavegamartin commented Nov 14, 2022

The previous example also fails in my Zettlr 2.2.5 install on Ubuntu. I'm very confused.
Broken
Ok

If there is anything more than i can do to test this out (specially if it doesn't reproduce on your machines) I would be very eager to help.

@nathanlesage
Copy link
Member

If there is anything more than i can do to test this out (specially if it doesn't reproduce on your machines) I would be very eager to help.

Sure! I mean, the best would be to just keep a look at it. Specifically, as soon as you notice it, make sure to open the logs and look as to whether there's something logged. If so it might be easy to fix.

The best one can hope for to fix a bug is reproducibility, so as soon as you've nailed reproducibility perfectly, I can trace the steps on my own machine to find where the app is breaking.

Also, make sure to switch to the nightly for that, because maybe that bug has already been fixed. It has been quite some time since the last release and a ton of stuff has changed in between! Plus, I think the nightly is by now already fairly stable (at least I'm using it in production and there's no data loss)

@cdelavegamartin
Copy link
Author

cdelavegamartin commented Jan 27, 2023

Testing this again, as I have now a bit more time, and have been wanting to use Zettlr in Windows as well as Linux.
I have installed the nightly build, default config, and the behaviour seems to be the same.

Here is again the minimal example for reference
test.zip

Log:

[18:57:20] [Info] こんにちは! Booting Zettlr at Fri Jan 27 2023 18:57:20 GMT+0000 (Greenwich Mean Time).
[18:57:20] [Info] Registering custom protocol safe-file
[18:57:20] [Warning] [Assets Provider] Found outdated filter links.lua; copying ...
[18:57:20] [Warning] [Assets Provider] Found outdated filter tags.lua; copying ...
[18:57:20] [Info] [Citeproc Provider] Loading CSL locale file at C:\Users\master\AppData\Local\Programs\Zettlr\resources\app.asar.webpack\main\assets\csl-locales\locales-en-US.xml ...
[18:57:20] [Info] [Update Provider] Checking for application updates ...
[18:57:20] [Info] [Updater] Checking https://zettlr.com/api/releases/latest for updates ...
[18:57:20] [Info] [FSAL] Loaded all files and workspaces in 0.000010499954223632812 seconds
[18:57:21] [Info] [Window Manager] Window Manager started.
[18:57:21] [Info] [Document Manager] Restored 1 open windows.
[18:57:21] [Info] [AppServiceContainer] Boot successful!
[18:57:21] [Info] [Application] Added C:\Users\master\AppData\Local\Programs\Zettlr\resources to PATH.
[18:57:21] [Info] [Application] The bundled pandoc executable is now in PATH. If you do not want to use the bundled pandoc, uncheck the corresponding setting and reboot the app.
[18:57:21] [Info] [Update Provider] No new update available. Current version is v2.3.0.
[18:57:22] [Info] [R] [Main Window (cd77cff8-9a94-4f37-b303-3cef18ef0711)] Loading i18n data ... (index.js:2)
[18:57:22] [Info] [R] [Main Window (cd77cff8-9a94-4f37-b303-3cef18ef0711)] i18n data loaded (index.js:2)
[18:57:40] [Warning] [R] [Main Window (cd77cff8-9a94-4f37-b303-3cef18ef0711)] Skipping linter warning "Missing newline character at end of file": No position (index.js:2)
[18:57:51] [Warning] [R] [Main Window (cd77cff8-9a94-4f37-b303-3cef18ef0711)] Skipping linter warning "Missing newline character at end of file": No position (index.js:2)

image

After adding a newline to Another Test Note externally with notepad, the warnings are no longer there, but the behaviour is still not correct:

[19:05:38] [Info] こんにちは! Booting Zettlr at Fri Jan 27 2023 19:05:38 GMT+0000 (Greenwich Mean Time).
[19:05:38] [Info] Registering custom protocol safe-file
[19:05:38] [Warning] [Assets Provider] Found outdated filter links.lua; copying ...
[19:05:38] [Warning] [Assets Provider] Found outdated filter tags.lua; copying ...
[19:05:38] [Info] [Citeproc Provider] Loading CSL locale file at C:\Users\master\AppData\Local\Programs\Zettlr\resources\app.asar.webpack\main\assets\csl-locales\locales-en-US.xml ...
[19:05:38] [Info] [Update Provider] Checking for application updates ...
[19:05:38] [Info] [Updater] Checking https://zettlr.com/api/releases/latest for updates ...
[19:05:38] [Info] [FSAL] Loaded all files and workspaces in 0.040460500001907346 seconds
[19:05:38] [Info] [Window Manager] Window Manager started.
[19:05:38] [Info] [Document Manager] Restored 1 open windows.
[19:05:38] [Info] [AppServiceContainer] Boot successful!
[19:05:38] [Info] [Application] Added C:\Users\master\AppData\Local\Programs\Zettlr\resources to PATH.
[19:05:38] [Info] [Application] The bundled pandoc executable is now in PATH. If you do not want to use the bundled pandoc, uncheck the corresponding setting and reboot the app.
[19:05:38] [Info] [Update Provider] No new update available. Current version is v2.3.0.
[19:05:39] [Info] [R] [Main Window (cd77cff8-9a94-4f37-b303-3cef18ef0711)] Loading i18n data ... (index.js:2)
[19:05:39] [Info] [R] [Main Window (cd77cff8-9a94-4f37-b303-3cef18ef0711)] i18n data loaded (index.js:2)

image

If I just save the note in Zettlr, no changes, now the frontmatter is parsed correctly,
[19:11:56] [Info] [DocumentManager] Processing change for C:\Users\master\Downloads\test\testfolder\20220521160158.md
[19:11:56] [Info] [WATCHDOG] Emitting event: change:C:\Users\master\Downloads\test\testfolder\20220521160158.md
[19:11:56] [Info] [DocumentManager] File C:\Users\master\Downloads\test\testfolder\20220521160158.md saved.
[19:12:15] [Info] さようなら! Shutting down at Fri Jan 27 2023 19:12:15 GMT+0000 (Greenwich Mean Time)

image

I noticed using VSCode that the note that fails, Another Test Note, uses CRLF whereas the one that gets read correctly Test note uses LF. Saving Another Test Note inside Zettlr doesn't change the line ending, despite now working. BUT, changing externally in VSCode the line endings to be LF instead of CRLF, it works correctly from the start. I have now tested this in my full set of notes, and switching all the notes to LF line endings everything is working correctly.

Not sure if this would be considered a bug anymore, but I think it would be useful if it didn't fail silently. I also left all the explanation of my debugging process in case it helps someone struggling with something similar, but I can edit the comment, or open a new issue explicitly stating that this is a problem due to line endings, if you consider this is actually a bug.

@BabakFarshchian
Copy link

I experience the same when I install the latest 3 beta in Windows 10. My tags in YAML don't show up, only hashtags in the text are visible in the tag cloud.

@nathanlesage
Copy link
Member

This should have been fixed in one of the most recent changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug that affects the functionality of Zettlr.
Projects
None yet
Development

No branches or pull requests

3 participants