Open maarzt opened 1 year ago
The incremental solution is very hard to build with mastodon data structures. It was our initial attempt and we failed to make it work against 100% cases. This failure is the main reason why we have this design currently in mastodon.
But it is also really not great when it comes to performance, and has a measurable cost in responsiveness, even if the user plans not to use the branch graph.
I would be in favor with solutions like "it is the responsibility of the caller to ensure blablabla". Now we must find a way not too clunky to have this in the UI. Maybe gracefully fail when we have invalid objects?
Problem Description
They problem can be reproduced like this:
Workaround
Update the branch graph after deleting spots or links: Click the "Regen. branch-graph" button.
Insights from investigating the problem
The ModelBranchGraph gets outdated when making changes to the ModelGraph. After deleting spots the ModelBranchGraph methods
getFirstLinkedVertex
,getLastLinkedVertex
andgetLinkedEdge
will return references to no longer existing spots and links. TheVertexBranchIterator
andEdgeBranchIterator
return wrong spot and edge references and might not terminate.The exception listed above is triggered because the
EdgeBranchIteration
returns wrong link references.Ideas how to fix this issue
Here is an example that demonstrates how the
branchGraph.edgeBranchIterator(...)
gives wrong results after deleting a spot in the ModelGraph:TODOs
Acceptance Criteria