Riverscapes / QRAVEPlugin

QGIS Plugin for viewing Riverscapes projects
0 stars 0 forks source link

Close projects who's business logic fails to load #40

Closed joewheaton closed 2 years ago

joewheaton commented 2 years ago

If a project fails to load (because of an error in business logic), it is still attempting to load in background until you shut down Q. I tried loading VBET 3 hours ago, and I just looked more carefully at Log and it is attempting and failing to load it every time I load other projects or refresh them.

We should recognize what a failure to load looks like (i.e. it is not showing up in tree), and then follow that up with a closing of the project.

philipbaileynar commented 2 years ago

I noticed similar problems trying to debug a business logic problem earlier today (#41). The only way to recover after the project load failed was to quit and restart QGIS.

MattReimer commented 2 years ago

Yup. Right now we don't have a failure state that prevents auto reload.

Gotta be a little careful to think about side effects here because we want to make sure that manual reload ignores this flag so that tool developers and business logic writers can still work without having to restart Q

Luckily this isn't constantly reloading, just Everytime the tree updates. This would be as easy as:

  1. Differentiating auto and manual reload
  2. Setting a flag setting per project
  3. Refusing to autoload the tree for projects that have already failed

A nice feature to have as well is to make sure to always render the root node no matter what so you have something to grab onto and close. This way there's not a possibility of having a hidden project you can't close.

philipbaileynar commented 2 years ago

A nice feature to have as well is to make sure to always render the root node no matter what so you have something to grab onto and close. This way there's not a possibility of having a hidden project you can't close.

Good point. ArcRAVE struggles with this too!

MattReimer commented 2 years ago

For now we'll just log the error and close.