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

The user input is silently not saved if yaml cannot be parsed #196

Closed
danieltomasz opened this issue Jul 8, 2022 · 7 comments
Closed

The user input is silently not saved if yaml cannot be parsed #196

danieltomasz opened this issue Jul 8, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@danieltomasz
Copy link

danieltomasz commented Jul 8, 2022

Describe the bug

  • Create database with a file where yaml is corrupted, for example with title: "title (no quote)
  • create a new column, and try to put some value there
  • the value is not saved, and there is no notification about an error
    Obsidian 0.15.4, plugin 1.8.2
    Also why the quotes are removed from string ?
    title: "Title" is becoming title: Title
@danieltomasz danieltomasz changed the title The user input is not saved in the yaml The user input is silently not saved if the there is a problem with yaml file Jul 8, 2022
@danieltomasz danieltomasz changed the title The user input is silently not saved if the there is a problem with yaml file The user input is silently not saved if there is a problem with yaml Jul 8, 2022
@RafaelGB
Copy link
Owner

RafaelGB commented Jul 8, 2022

Hi @danieltomasz, the error handler could be improved with notifications, I am agree. I will add them when the react migration its finished.

If the yaml is not well constructed the edition will fail. The unique error already controlled is when the yaml do not exist or there is a duplicate (inline with frontmatter or frontmatter with inline)

@RafaelGB RafaelGB added triage Issue not tagged yet. talking to the user Discarted Feature or request discarded labels Jul 8, 2022
@RafaelGB RafaelGB added bug Something isn't working and removed Discarted Feature or request discarded labels Jul 8, 2022
@danieltomasz
Copy link
Author

danieltomasz commented Jul 8, 2022

Also I was able to identify use cases where plugin fails
For example, someone might use this schema with title title:'@title' single quoted scalar which is a proper yaml entry, but the plugin is failing on it (the title:@title with plain scalar is not a proper yaml)
https://www.yaml.info/learn/quote.html

But I this this is a limitation of how the yaml entries are parsed in your plugin and is hard to do something with it?

One use case when I see this might be a problem is people including bibtex citekey into they bibliographic notes like citekey:'@citekey', which is quite popular use for obsidian, or people using special character like ! into beginning of title to visually categorize the notes

If changes in parsing are not easy to do, maybe documenting what kind of input could be parsed might be useful?

@danieltomasz danieltomasz changed the title The user input is silently not saved if there is a problem with yaml The user input is silently not saved if yaml cannot be parsed Jul 8, 2022
@RafaelGB
Copy link
Owner

RafaelGB commented Jul 8, 2022

I am using the ParseYaml function of Obsidian + Dataview Inline search for inlines.

The value requires an space after : to work

@RafaelGB RafaelGB removed the triage Issue not tagged yet. talking to the user label Jul 8, 2022
@danieltomasz
Copy link
Author

danieltomasz commented Jul 8, 2022

I think it doesnt work because your plugin strip quotes from scalars,
title: '@title' is a valid yaml entry but title: @title is not
plugin cannot process title: '@title' , and dont save the values in yaml/display them in the table

You could compare results

---
title: title
Topic: topic
---

image

with

---
title: '@title`
Topic: topic
---

image

@RafaelGB
Copy link
Owner

RafaelGB commented Jul 8, 2022

I just test '@value' and works with 1.8.2

Notice that in your sample there are different types of quotes wrapping the value

` instead of '

@danieltomasz
Copy link
Author

indeed, sorry for the confusion!

@RafaelGB
Copy link
Owner

RafaelGB commented Jul 8, 2022

Do not worry, I am happy to help!

About the error handler will takes time. The migration of react-table version and react will take 2 months aprox... But will be worth for sure!

@RafaelGB RafaelGB self-assigned this Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants