ctreffe / alfred

Alfred - A library for rapid experiment development
MIT License
10 stars 1 forks source link

Debug mode jumplist has to account for dynamic showifs #130

Open jobrachem opened 2 years ago

jobrachem commented 2 years ago

Currently, a dynamic showif method on a page may cause a crash of the debug mode, because all showifs get evaluated for the creation of the jumplist.

ctreffe commented 2 years ago

So, this concerns jumplists on all pages regardless of debug mode being activated or not, right?

jobrachem commented 2 years ago

You're right! The error will appear every time that a JumpList is used together with pages with a dynamic showif (i.e. the showif method tries to access a value that is not present at the time of the JumpList being activated on a page). Should be actually easy to solve by using the dict.get method and, if necessary, try-except blocks in the showifs themselves. That's a solution on the level of experiment programming that does not require an update to alfred.

For the debug mode however, you will wish to simply turn the debug mode on and have everything work. That does require an update.

But we may also want to put some more thought into how dynamic showifs should be handled by a JumpList.