Silverbullet-treeview stopped working!

Link to plugin: GitHub - joekrill/silverbullet-treeview: SilverBullet TreeView plug

After the new update for v2, plugin stoppped working and is now throwing the error:
Error: Function queryLuaObjects not found

Not too sure why it will throw error saying the function don’t exist, while it’s still documented here index ? Anyone has any idea how to fix?

Seems like the same happened with graphview as well. Also atleast for me, index.defineTag(…) way of attaching a metatable to a tag also seems to have stopped working in edge. @zef Any breaking changes on edge ? I couldn’t see any from changelog.

I can confirm this too, just tried latest edge:
SilverBullet 2.4.1-812dee8537dc9823219672a214d521f04578a3b6
TreeView stopped working. it doesn’t launch at all, and console spits out this error:

image

Reinstalling doesn’t help either.

PS: As an alternative until it’s resolved you can try out my Document Explorer installable from my Repo, maybe you like it too;)

1 Like

These are two different things, I’m pretty sure. I deleted index.defineTag because I didn’t like it and am working on a replacement for the old use case. It was an experimental feature, really. How are you using that @deepkn ?

On the queryLuaObjects not being found — right, I’ll try to fix that. It’s now a syscall, but I can probably re-add it as a function to fix treeview.

Ok, I put back queryLuaObjects on main now, treeview works again.

I’ll now also see if I can readd index.defineTag, although I’ll probably deprecate it in favor of something else.

I had this as a somewhat of a hacky workaround to the v1 attribute extractor, adds a metatable with some of the extracted attributes to tasks - that’s my only use case for it. Is the new ‘tag.define’ postprocess callback the alternative you’d suggest to something like that ?

Yes, but give me a few days to make sure the design of that is right. For now I’ll try to put back the old API.

Ok, just pushed another commit putting back index.defineTag for now.

1 Like

I’ve upgraded to the latest edge version but index.defineTag with metatable still doesn’t seem to work for me. I’m okay with moving over to using postprocess callback though - if that’s our way forward.

Really? Can you be more precise in how you’re using it and from what contexts?

I use it in one single space script - the one I posted above: (v1) Migrating from Obsidian-Tasks - #23 by deepkn and that’s about it :slight_smile: (Also the reason why I’m not too worried about it) what I’m seeing now is that the sb is no longer able to utilize the metatable even if I set it - I.e if I query for extraAttrs in the script above, I get null.

Strange, when I’m testing something similar:

```space-lua
index.defineTag {
  name = "task",
  metatable = {
    __index = function(self, attr)
      if attr == "loudName" then
        return string.upper(self.name)
      end
    end
  }
}
```

With ${query[[from z = index.tag "task" select z.loudName limit 3]]}

I do get screaming tasks. Are you sure you’re on the latest edge build?

Hmm.. something strange happened for sure. I just did a wipe client and reload and now indexing seems to be stuck somehow. My homepage does not load completely and queries don’t resolve and the like.. no errors in the logs though.

Ehm… that’s not good. You don’t happen to have multiple tabs open? I sometimes get into a weird state if I have multiple SB tabs open and then upgrade.

And it magically started working again on a reload. :man_facepalming: I did have two tabs open in this case though. Had closed one before the reload that got it back to working. To be fair, I’ve been living on edge builds for the last 8 months or so - and I’ve encountered this only twice (including this instance). Anything in particular you’d like to capture if I hit it again Zef ?

I suspect it was two tabs holding on to a service worker which then somehow cannot update itself. I had this happen too today. Once you close one tab and reload the other the whole thing starts going again…

1 Like