Trilium: inherited iconClass attribute not honored in 0.44.4

Created on 27 Sep 2020  路  9Comments  路  Source: zadam/trilium

I identified this issue after upgrading to 0.44.4.
I'm on Ubuntu 20.04 linux and using the deb package.

My day note template (and my other templates!) have iconClass specified as an attribute:
daytemplate

Indeed, my various templates show up in the tree with their selected icons:
templates

However, after the upgrade, my various template instances are only displaying their default note/folder icons, but manually adding iconClass to any of them (observe the "Journal" root node) does still work.

journal

If you're a little underwater, I'm happy to take a look at putting together a PR on this one. Trilium has been super helpful to me in just the short month I've been using it and I'm excited to be able to give back.

All 9 comments

Hi, unfortunately I'm not able to reproduce this issue - inherited iconClass seems to work correctly for me.

Does the iconClass show up among inherited attributes in the "templated" notes, like this?

Indeed it is! Here's a screenshot from the web UI, synced with the same client.
inherited

Any particular logs that would be helpful for me to share?

That is pretty weird since Trilium seems to be aware of that inherited attribute...

Just to be sure - reload of the page in the browser does not help, right?

Refreshing did not help, no.
I changed the iconClass on the template and it did propagate out, however. Is there perhaps a cache that I invalidated in that change?

Yes, there is a cache and the code to choose icon uses it. However this cache is in frontend memory and is reloaded together with the page so reload should fix it as well.

There is also a backend cache which has longer lifetime (until restart/stop of backend) but then this cache is not used for choosing icons ...

So the mystery remains ...

Let me see if I can use anonymize-database against a backup to get you a useful repro :)

Zipped video of repro steps:

  1. Load anonymized db (I anonymized my before-upgrade backup)
  2. Click around in a number of day notes, which all use the default icons.
  3. F5 a few times.
  4. Close and reopen.
  5. Observe the default icons are still used.
  6. Open the template.
  7. F5.
  8. Observe that the correct custom icons have propagated (I guess my earlier "changing the iconClass on the template" was actually "open the template at all".)
  9. Close.
  10. Replace the active document with the anonymized DB again.
  11. Repeat for good measure.

trilium_repro.zip

And here's a copy of the anonymized DB:
anonymized-document.zip

Just confirming that I'm currently having the same problem with 0.44.4.

  • for me, it's a mix: some notes/subtrees show default icons, some a mix of default + template ones, some are completely correct. See screenshot below.
  • refreshing the page _sometimes_ helps but not systematically

image

Nothing strange to be seen in frontend or backend logs.
Just noticing this:

08:09:39.190 Slow POST /api/tree/load took 10ms

in the backend log, but that's probably not related?

@elementc , thanks a lot for the anonymized database, this allowed me to reproduce and fix the issue!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zadam picture zadam  路  4Comments

gerroon picture gerroon  路  6Comments

apg-dev picture apg-dev  路  5Comments

gerroon picture gerroon  路  5Comments

TTtrace picture TTtrace  路  5Comments