openlcb / OpenLCB_Java

A git-managed copy of the SVN-based Java prototype implementation of OpenLCB. This implementation operates inside JMRI.
6 stars 9 forks source link

invalidate cached CDI XML files #109

Closed balazsracz closed 2 months ago

balazsracz commented 6 years ago

Currently we cache the CDI's XML structure in memory so long as the program is running. We should invalidate this cache if we see that a given node's hardware name/version/softwarename/version changes. This should catch cases when a node comes up in bootloader mode.

bobjacobsen commented 1 year ago

What would the user see in this case? Should the CDI configuration window close, to indicate that it needs to be reloaded? Or should it automatically reload CDI? And then refresh content?

One approach would be to post a JOptionPane dialog telling the user what happened, with just a "Continue" button. Clicking that closes the window. But that might be too disruptive.

atanisoft commented 6 months ago

@bobjacobsen Ideally if the node has rebooted and the fields that @balazsracz mentioned changes the cached XML should be discarded and re-pulled from the node as it may have changed. If the users is already in the CDI dialog for the node then I think your JOptionPane approach seems reasonable, the disruptive part may be unavoidable.

bobjacobsen commented 2 months ago

OpenLCB and JMRI now invalidate CDI (and close any open edit window) when a firmware download starts.

I think this can be closed.

dpharris commented 2 months ago

Resolved with updates.