Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch features disappear on project opening #325

Conversation

stefanhahmann
Copy link
Collaborator

@stefanhahmann stefanhahmann commented Sep 13, 2024

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:

  • testBranchFeaturesAfterSaveAndReload in ProjectLoaderTest tests, if previously computed branch feature still exist, if the project has only been saved and reloaded
  • testBranchFeaturesAfterOpeningBranchView in MamutBranchViewTrackSchemeTest tests, if previously computed branch features still exist, after a TrackSchemeBranchView window was opened
  • testKeepBranchFeaturesAfterSyncWithoutChanges in BranchGraphSynchronizerTest tests, if previously computed branch features still exist, after the sync() method of BranchGraphSynchronizer was called without any previously notified changes to the graph
  • testKeepBranchFeaturesAfterSyncWithChanges in BranchGraphSynchronizerTest tests, if previously computed branch features still exist, after the sync() method of BranchGraphSynchronizer was called with previously notified changes to the graph. Since this is a current known issue, this test is ignored.

Resolves #279

@stefanhahmann stefanhahmann self-assigned this Sep 13, 2024
@stefanhahmann stefanhahmann marked this pull request as ready for review September 13, 2024 13:42
@stefanhahmann
Copy link
Collaborator Author

@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?

@stefanhahmann stefanhahmann force-pushed the branch-features-disappear-on-project-opening branch from a715467 to de4832d Compare September 17, 2024 16:04
… graph is up-to-date, when it is created

* Only actually run the sync() method, if it has been informed that the branch graph is not up-to-date anymore before
* With the old 1gb setting the CI sometimes resulted in OutOfMemory Errors
Copy link
Contributor

@tinevez tinevez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@tinevez tinevez merged commit 44564eb into mastodon-sc:dev Sep 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants