coddingtonbear / obsidian-local-rest-api

Unlock your automation needs by interacting with your notes in Obsidian over a secure REST API.
MIT License
607 stars 56 forks source link

POST /search/gui meets searchDom.children is not iterable #71

Closed Kherrisan closed 9 months ago

Kherrisan commented 1 year ago
{
  "message": "Internal Server Error\nsearchDom.children is not iterable",
  "errorCode": 50000
}

I am not sure whether searchDorm.children is an alias for searchDom.vChildren._children or not, due to some underlying dynamic attribute binding features. Anyway, i replaced .children with .vChildren._children and it worked.

Besides, another crash happened as follows:

{
  "message": "Internal Server Error\nresult.result.content is not iterable",
  "errorCode": 50000
}

I found that it happened when the query text matches the file name, but the file content doesn't contain any matched text.

Some version info:

coddingtonbear commented 1 year ago

Yes, the /gui/ search was always going to be very brittle given that that is not a documented API.

There are two ways we could take this:

  1. Maybe you (or somebody else here) could find the problem and post a pull request that fixes the /gui/ search?
  2. I could remove this API in the next version given that it will require more maintenance over time than I can reasonably commit.

:crossed_fingers: that you file a PR!