Skip to content

Conversation View Color Exception fix #2319

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

Merged
merged 1 commit into from
Jun 17, 2025

Conversation

Auriga2
Copy link
Collaborator

@Auriga2 Auriga2 commented Jun 16, 2025

Prerequisites

  • Reviewed the checklist

  • Reviewed feedback from the "Sonar Cloud" bot. Note that you have to wait
    for the "CI / Unit Tests") to complete first. Failed Unit tests can be
    debugged by adding the label "verbose logging" to the GitHub PR.

Description of the Change

The issue was caused due to the (sender < colorPositions.length) check in the DefaultConversationColorProvider, where the sender is a vertex id and the colorPositions.length is graph Vertex count. The vertex ids are not in order for graphs created by file importer as it adds 2 vertices for each transaction and then merge unique vertices accordingly. This results in certain vertex Ids > graph Vertex count, failing the above check for certain valid Vertices.

The same scenario can also occur on a graph manually created: On nodes last added after deleting some previously added nodes. (As explained below)

This is the intentional behavior of the code in in ElementStore.java: Vertex/Element ids are not guaranteed to be in order (stored in position2id) , only the Element positions (stored in id2position) are meant to be in order (and each being below Vertex count).
image

Hence I removed that check as it appears to lack any clear purpose. If we ever need to add a check here, we can validate the Element position instead.

Alternate Designs

If we ever need to add a check here, we can validate the Element position instead.
Initially I tried to rearrange the id2position array, to be similar to a graph opened by constellation, but it doesn't fix the issue on a graph later edited by removing nodes. Also the purpose of 2 arrays in ElementStore is also to facilitate this, making it an incorrect fix.

Why Should This Be In Core?

Fix exception

Benefits

Possible Drawbacks

n/a

Verification Process

  • Create a graph with 4 nodes, add 4 more nodes and delete the previous 4 nodes. Add a transaction and conversation data and view in conversation view. Verify no exception is thrown.
  • Verify the exception is not thrown on a graph imported by the file importer as explained in Conversation View Color Exception #2271

Applicable Issues

#2271

Copy link

@Delphinus8821 Delphinus8821 merged commit 48c1943 into master Jun 17, 2025
3 checks passed
@Delphinus8821 Delphinus8821 deleted the bugfix/conversation_view_color_exception branch June 17, 2025 01:25
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.

3 participants