mastodon-sc / mastodon

Mastodon – a large-scale tracking and track-editing framework for large, multi-view images.
BSD 2-Clause "Simplified" License
69 stars 20 forks source link

Branch features disappear on project opening #325

Closed stefanhahmann closed 2 months ago

stefanhahmann commented 2 months ago

This Pull Request changes behavior of the BranchGraphSynchronizer. The BranchGraphSynchronizer is set to optimistically assume that the branch graph is up-to-date = true at the time the synchronizer is created. The sync() method evaluates the up-to-date flag and only performs the rebuilt, if the up-to-date flag is set to false, which is usually the case, after the notifiers have informed the synchronizer that the graph had been changed.

By this change, it can be achieved that, the branch features are not reset/lost after saving and re-opening a project or by just opening a track scheme branch view.

This Pull Request adds some unit tests to test the indented behavior:

Resolves #279

stefanhahmann commented 2 months ago

@tinevez I am not sure, if this PR would contradict what you had in mind earlier, when you introduced the strategy to frequently update the branch graph to have it up-to-date in as many situations as possible?